'Tick-Wait' within Strategy Tester

 

Hello,

In MT4, when an Expert Advisor is initialized and loaded, the init start function is executed when a tick comes in. However, this is the important part, according to this website, the Expert Advisor will only execute on the next tick, if it has already completed the running from the last tick. So, the EA goes into 'tick-wait' mode, only after it has completed its run and hands over control back to the terminal.

My problem is that Strategy Tester does not appear to do this. Strategy Tester appears to be running on each tick and every tick it generates. Strategy Tester is running on possible all the ticks it generates and doesn't actually wait for the prior launched code to complete. Can anyone confirm this? I found this out, because I use CSV files, and during read and writes, I find that one EA has a file open, but then the EA is executed again, and access the file again, even before the prior execution has completed its code. Sometimes there are up to four ticks overlapping in execution, which throws off my system. 

(I understand that the ticks are generated from larger data, the question here is "when these ticks are generated, does the Tester wait for the previous execution to complete even while generating ticks before moving on to a new execution or does it execute on every single tick regardless of if prior execution is finished). And how do I get it to wait?

Thanks. 

 

If I understand you correctly, your EA creates a CSV file, that has mismatched content. From this fact you deduced that ticks in Strategy tester were processed concurrently.

It would make no sense to run expert in Strategy tester multi-threaded and I believe it does not. The reason for the file inconsistency must be somewhere else, either in your code, or in CSV file handling of MT4 terminal.

 
Gigledalmer:

Hello,

In MT4, when an Expert Advisor is initialized and loaded, the init start function is executed when a tick comes in. However, this is the important part, according to this website, the Expert Advisor will only execute on the next tick, if it has already completed the running from the last tick. So, the EA goes into 'tick-wait' mode, only after it has completed its run and hands over control back to the terminal.

My problem is that Strategy Tester does not appear to do this. Strategy Tester appears to be running on each tick and every tick it generates. Strategy Tester is running on possible all the ticks it generates and doesn't actually wait for the prior launched code to complete. Can anyone confirm this? 

In the Strategy Tester start() is called for each and every tick,  no ticks are ever missed . . .  it is impossible for a tick to be missed in the Strategy Tester. The next tick is not called until start() has completed,  it is impossible for start() not to complete and the next tick to be called,  the speed at which start() runs and completes governs the speed at which the Strategy Tester runs . . .  on max speed setting.
Reason: