Invalid Stops using my multisymbol Expert - page 2

 
Filip #: yes this might be... but I dont think that this is here the problem. As i sayed before: If I run the expert just with one symbol, it does not produce such a problem. 

In my testcase I run it with AUDUSD AND EURUSD, is there anything which can influence the positions by a position in the other symbol - or maybe by previous events? 

Without a proper analysis and debugging of your entire code, and exact information about the testing environment, it is difficult to say.

Remember however, in a multi-symbol environment, there are no tick events for the other symbols besides the chart symbol.

So, in those cases, you have to continuously make sure that the symbol quote prices and other data is always kept "fresh".

Any small delay between the capture of the data in their eventual use could lead to slippage.

 
Filip #:

yes this might be... but I dont think that this is here the problem. As i sayed before: If I run the expert just with one symbol, it does not produce such a problem. 

In my testcase I run it with AUDUSD AND EURUSD, is there anything which can influence the positions by a position in the other symbol - or maybe by previous events? 

Hi! You are getting this error on AUDUSD while you are running this EA on two pairs simultaneously… but on which chart are you loading the EA? AUDUSD or the other one?! 
Also… just for my own curiosity… how is that better to run a multi symbol EA, instead of running the EA on each chart ? Thanks 
 

Hi Daniel, 

with a bot running on 20 symbols you can produce a lot more trades which helps to geht more statistical meaningfulness. Besides this, if you hav 20.000 trades you can filter a lot , to leave only the good ones but still have enough for your statistical relevance...

Im running the bot in a AUDUSD window ...

 

Now I figuered out, that if I use the MT5 CTrade Class instead of my code than everything works... So in the function which I showed here in this thread at first must be something confusing the MT5 Terminal....

Now i changed this : 

if(request.sl > 0)
        {
         bool sent = OrderSend(request,result);
         if(!sent)
           {
            Print("OrderSend TSL error: ", GetLastError());
            Print("OrderSend succeeded. Result retcode: ", result.retcode, " comment: ", result.comment);
                    
           }
        }

to that : 

 if(request.sl > 0)
        {


         CTrade Trade;
         Trade.PositionModify(positionTicket,newStopLoss,0); //PositionModify(const ulong ticket,const double sl,const double tp)
        }

the before calculated SL is the same.... 

Ill investigate further ;)

 
I was wrong... the CTrade code did not change anything: But the conditions changed! Today , on Monday morning everthing seems to work fine, but it was not the code it was the broker. Now , in the evening, the problem returned with both versions of the code...  
 
Filip #:

Hi Daniel, 

with a bot running on 20 symbols you can produce a lot more trades which helps to geht more statistical meaningfulness. Besides this, if you hav 20.000 trades you can filter a lot , to leave only the good ones but still have enough for your statistical relevance...

Im running the bot in a AUDUSD window ...

But the conditions are the same, you should get the same trades if you run the EA on each chart