= My EA on MT5 (MQL5) modifies TP "only sometimes", but sometimes it does not. The issue happens only on Real , never in Demo. =

 

Hi Friends,


Background:

MT4

  • I successfully write my own EA using MQL4 running on MT4.
  • I've happily enjoyed it upon my own strategy and earned the satisfied profit for the past 4 years without any incident of an order having a wrong TP/SL/Open price.
  • My strategy is a simple martingale opening 5 orders max. TP of each order opened will follow the TP of last order (as everyone's aware). 

MT5

  • Upon the impressive strategy, I challenged myself a bit starting to write it up using MQL5 and to run on MT5.
  • I validated the MT5 EA via a back testing and the result is exactly what I expected. The result is exactly what I had an impressive result on MT4. 
  • Upon my MT5 EA on a back testing, every order is opened correctly at the correct open price with  correct SL and correct TP.
  • Then, I run my EA (MT5) on both Demo account and Real account with exactly the same EA and the same set file.

Problem:

  • I found out the MT5 EA sometimes does not modify the TP. The martingale concept is each TP of earlier opened orders must be modified to be the TP of the newly opened order. 
  • The funny (and scary ) thing is it happens to only Real Account and 'only sometimes". The issue never happens in Demo account. 
  • Note that both Demo account and Real account  are run  on VPS 7x24 connected to IC Markets server.

Summary:

  • I can't figure out why the TP of earlier opened orders are not modified to be the TP of the newly latest opened order.   (following my strategy scripted in my own MT5 EA)
  • The issue  happened to only Real Account and it only happened 'sometimes'.  Could anyone suggest why ? 


Cheers,

Jeff


 
jeff.tottenham2016:

Hi Friends,


Background:

MT4

  • I successfully write my own EA using MQL4 running on MT4.
  • I've happily enjoyed it upon my own strategy and earned the satisfied profit for the past 4 years without any incident of an order having a wrong TP/SL/Open price.
  • My strategy is a simple martingale opening 5 orders max. TP of each order opened will follow the TP of last order (as everyone's aware). 

MT5

  • Upon the impressive strategy, I challenged myself a bit starting to write it up using MQL5 and to run on MT5.
  • I validated the MT5 EA via a back testing and the result is exactly what I expected. The result is exactly what I had an impressive result on MT4. 
  • Upon my MT5 EA on a back testing, every order is opened correctly at the correct open price with  correct SL and correct TP.
  • Then, I run my EA (MT5) on both Demo account and Real account with exactly the same EA and the same set file.

Problem:

  • I found out the MT5 EA sometimes does not modify the TP. The martingale concept is each TP of earlier opened orders must be modified to be the TP of the newly opened order. 
  • The funny (and scary ) thing is it happens to only Real Account and 'only sometimes". The issue never happens in Demo account. 
  • Note that both Demo account and Real account  are run  on VPS 7x24 connected to IC Markets server.

Summary:

  • I can't figure out why the TP of earlier opened orders are not modified to be the TP of the newly latest opened order.   (following my strategy scripted in my own MT5 EA)
  • The issue  happened to only Real Account and it only happened 'sometimes'.  Could anyone suggest why ? 


Cheers,

Jeff


A guess would be, different freeze or stops levels on real account.

You need to add error reporting to Order send function, such that you know when something goes wrong.

Without any details, it's just guessing, poking around.
 
Dominik Egert #:
A guess would be, different freeze or stops levels on real account.

You need to add error reporting to Order send function, such that you know when something goes wrong.

Without any details, it's just guessing, poking around.
Thanks to you Dominik, right. I'll check and need to add error reporting to Order Send function. Another homework yet worth. :) 
Reason: