Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1047

 
Roman Sharanov:

And without debugging? Simply, set the date in the tester to the exact minute and wind it up quickly?

How is the test different from debugging? Only it is run directly from the code. The parameters are set and the speed is adjusted in the same way.

 
Alexey Viktorov:

What's the difference between a test and a debug? Only it is run directly from the code. The parameters are also set and the speed is adjusted in the same way.

Got it, thank you.

 
I'm continuing my futile search in MT5 and google the rules of writing the set file after optimization in MT5, as I did in MT4 (save download), I also did not find the rules of updating from the EA set file, previously installed on the MT5 chart panel trades. Please advise what to do with this MT5 confusion ?
 

Working via CTrade
Trade does not have a stop
need to modify take

trade.PositionModify(PositionGetTicket(i), PositionGetDouble(POSITION_SL), tpLvl);

Invalid Stops error, what to do?

CanI write something else instead ofPositionGetDouble(POSITION_SL) ?

 
Roman Sharanov:

I work via CTrade
Trade does not have a stop
need to modify the take

Invalid Stops error, what to do?

Maybe instead ofPositionGetDouble(POSITION_SL) write something else?

What is this "tpLvl" miracle? Is its value normalized, is it possible to put it where you put it?

 
Vladimir Karputov:

Figure out what the wonder "tpLvl" is: is its value normalised, can it be put where you put it?

ahhh, Invalid Stop could also mean that the wrong take?

But nevertheless, on the chart the take is normally put in the right place

 
Roman Sharanov:

Ahhhh, Invalid Stop could also mean that the wrong take?

But nevertheless, on the chart the take is normally in the right place

I need more details to reproduce: symbol, date, mql5 code, logs, exact description of where on the chart and at what moment the error occurred
 
Vladimir Karputov:
We need more details to reproduce: symbol, date, mql5 code, logs, exact description of where on the chart and at what moment the error occurred
void transposeTakeProfit(double tpLvl){
        for(int i = PositionsTotal() - 1; i >= 0; i--){
        PositionSelectByTicket(PositionGetTicket(i));
        if(PositionGetString(POSITION_SYMBOL) == _Symbol && PositionGetInteger(POSITION_MAGIC) == _magic){
                trade.PositionModify(PositionGetTicket(i), PositionGetDouble(POSITION_SL), tpLvl);
        }
   }
}

Well this is where it happens, a trade is opened, a level is passed to which all takeovers should be moved, if there are other trades

But this is the first deal, goes immediately into this function and immediately an error

 
Roman Sharanov:

Well this is where it happens, a trade is opened, a level is passed to which all takeovers should be moved, if there are other trades

But this is the first trade, goes straight into this function and immediately an error

Read my comment above. If at least one point is not met, I personally will not do telepathy :)
 
Vladimir Karputov:
Read my comment above. If any point is not met, I personally will not be engaged in telepathy :)

the point of throwing out all 900 lines of code, you won't understand it anyway. The error occurs specifically in PositionModify, I checked it with debugger

Well, the symbol is EURUSD and the date is May 2,

Reason: