Errors, bugs, questions - page 112

 
sandex:

Who has used the OrderCheck function.

Here is a construction like this:

           MqlTradeRequest request;
           request.action=TRADE_ACTION_DEAL;
           request.symbol=_Symbol;
           request.volume=volume_exe;
           request.price=SymbolInfoDouble(_Symbol, SYMBOL_ASK);
           request.sl=0;
           request.tp=0;
           request.deviation=SymbolInfoInteger(_Symbol, SYMBOL_SPREAD)*2;
           request.type=ORDER_TYPE_BUY;
           request.type_filling=ORDER_FILLING_CANCEL;
           MqlTradeResult result;
           OrderCheck(request, result);
           if(OrderSend(request, result)==false)

When compiling, I get an error: 'result' - parameter conversion is not allowed.

If you remove OrderCheck, everything compiles normally and position opens in the tester.

Look at the description of the function. It says about MqlTradeCheckResult response structure.
 
Yedelkin:
Have a look at the description of the function. It says about MqlTradeCheckResult response structure.

Thank you very much.

 
Dmitriy2:

Here's what it is...

It should count the profits of the trades from the date specified. It gives a completely different result than it actually is. For example I got 611 instead of result about 2000. I've started checking per day (commented line). There are(!!) days when the result is the same, but usually it is not what it should be...(I couldn't find any regularity). And the debugger produces the same exact cycle for the whole amount of trades. Although I can only trace just this number of deals because no values are displayed for any other variables except for int variables (Expression could not be evaluated).

Is this code correct and am I using the debugger correctly...?

The transaction loop should be

for(i=0;i<HistoryDealsTotal();i=i++)
In the debugger, use 'Step in' (F11). Then, entering a function where a variable or expression is defined will show its value.
 
Valmars:

The transaction cycle should be

In the debugger, use 'Step with Entry' (F11). Then, when you enter a function where a variable or expression is defined, it will show its value.

let's say that the cycle starts from zero... although where is it written that deal numbers start from zero? Judging by the fact that now we have 10611 (before it was 611, instead of about 2000), ie, plus the size of the original deposit, I'm not sure about it ... even if it is zero even one I still do not understand where 10,000 comes from

Debugger, I see, F11...

 
Dmitriy2:

let's say the cycle starts from zero... although where is it written that deal numbers start from zero? Judging by the fact that now you get 10611 (before it was 611, instead of about 2000), ie, plus the size of the original deposit, I'm not sure about it ... even if it is zero even one I still do not understand where 10,000 comes from

Debugger, I see, F11...

The first deal is usually a deposit. It seems that deals are counted in the history starting from 0. Thus, if I'm not mistaken the 0-th deal will be a deposit.

Can I clarify the formula by which the profit on the deal is calculated?

PS

If memory serves me correctly, the result should be calculated like this - TotalProfit = Profit+Swap-Commision;


 
Kos:
Why does SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_LIMIT), return zero?
0 means no restrictions.
 
Interesting:

The first transaction is usually a deposit. So, if I am not mistaken, the 0th trade will be a deposit.

Can you specify the formula used to calculate the profit on the deal?

PS

If memory serves me correctly, the result should be calculated like this - TotalProfit = Profit+Swap-Commision;


on the last page in full code

by this code, the deposit should not be taken into account in any case

the commission is also plus - it is minus.

 
Yedelkin:

At first the compiler complained that "#import "lbS7N_Servis.ex5"" was missing.

After deleting this line it gave out:

2010.08.28 22:19:51 Servis[1] (EURUSD,H1) L1=1016990000 L2=1016990000 L3=6617010000 M1=1016990000
2010.08.28 22:19:51 Servis[1] (EURUSD,H1) A=101699 B=101699 C=661701
2010.08.28 22:19:51 Servis[1] (EURUSD,H1) --- OnInit() --- 1 --- !

When I replaced the account number in the code with my account number, I got:

2010.08.28 22:26:46 Servis[1] (EURUSD,H1) L1=1016990000 L2=1016990000 L3=1016990000 M1=1016990000

2010.08.28 22:26:46 Servis[1] (EURUSD,H1) A=101699 B=101699 C=101699

2010.08.28 22:26:46 Servis[1] (EURUSD,H1) --- OnInit() --- 1 --- !

MQ server, build 316.

Thank you. Everything is working as it should be with you. I haven't figured it out yet.
 
sergey1294:

and my M1 didn't match.

It means that you also have a bug, but less than me.

Maybe you should be looking for it in the program's connection to the system.

What kind of system do you have?

I have a core2duo 1.3 Ghz 64 Win7 HB license, 4GB ddr 2 RAM, build. 316

 
simpleton:

And there are as many as three unique situations. These are the detected ones. And how many undetected?

And with this state of affairs MetaQuotes is going to start the Championship 2010 in a month?

Oh, how many "wonders" MetaTrader 5 has in store for us...

The winners will be those whose programs contain so many errors that, in combination with minor glitches in the program, they will have such an effect that no one will ever catch up with them.
Reason: