EA starts before MT4 has a chance to login to broker Account, when launced from the command line.

 

Hi all,

I'm starting a back testing EA (NNFX Algo Tester) from the command line using *.ini files. The problem is, it start so fast, without letting MT4 to login to the broker server first.

Of course, I wouldn't have this problem if there's a way to start an EA on an already open (and logged in) terminal -- but I don't know a way to do that. Do you?

Here's the funny thing. On a default installation I never had this problem, because MT4 checks for history files etc before launching the EA, and login process will have completed by then.

A while ago, I started using exported tick data from Dukascopy (because broker data is crap in quality and retention alike). You'd probably know, data export tools (e.g. QuantDataManager) mark the history files as read only so MT4 can't overwrite it.

After the switch, MT4 notices that the history files are read only,  skips history check all together, and starts the EA a little too fast...

TestGenerator: file "C:\Users\fxuser\AppData\Roaming\MetaQuotes\Terminal\7C8E90B62B9DC3A2993911815FAC6BA6\tester\history\AUDCAD1440_0.fxt" is read-only

This means, I can't have command line launch and high quality data at the same time -- I need to choose one, which really sucks :( 

I'm not a developer and super new to MT4, EAs etc so I'd appreciate some suggestions from gurus... Potential approaches may include:

  • Find a way to start EA on an already open MT4, instead of re-starting MT4 for each test.
  • Inject an artificial delay between the MT4 start and EA run.
  • Block MT4's annoying urge to overwrite history data no matter what unless they are Read Only -- And why MT4 doesn't like or keep my perfectly fine exported data?? 
  • Contact the EA developer to see if there's a way to delay the broker login checks (in progress)
  • ...

Thanks in advance!

 

I noticed that my description of the problem is hard to follow, so here's a much simplified version ;)

NNFX Algo tester cannot identify the license when *both* of these are True:

  • MT4 started from the command line using an "ini" file (https://www.metatrader4.com/en/trading-platform/help/service/start_conf_file)
  • The history file (under <data_folder>\tester\history) for the symbol is Read Only (which is common for exported history data to protect them from being overwritten by MT4)


If one of these is False, everything works just fine.

 
memo_mqlcom: MT4 started
Why did you post your MT4 question in the Root / MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
          General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon.
Reason: