How to test an EA when there aren't ticks coming?

 
Use the Strategy Tester.
 
 

Perhaps you just wanted to run an EA on a chart without using the Strategy Tester? (Ie. for EA's which contain their own backtesting elements).

For this you can always place start(); at the end of the init() section so that once the init() is complete it will jump straight into the code of the start() section without needing to wait for the first tick to come in.

 

clerin6 For this you can always place start(); at the end of the init()

NO! This is not allowed. There is no chart set up yet. https://www.mql5.com/en/forum/128803/page2#373533
 

I don't understand what is meant by "not allowed". I do this all the time, and still get correct results (which I have verified with manual testing). I'm guessing you mean "not advisable"? (Possible problems with GUI and re-establishing ticks, etc.).

I gather that the method of using PostMessageA recommended here (https://www.mql5.com/en/forum/128803/page2#373533) doesn't work if you initiate the EA when there is already no connection (for example over a weekend).

7bit 2010.09.26 16:58


[...]

For the problem of starting MT4 in a disconnected state it does not provide a solution.

As far as I can see, that is correct. In this case there is no other method I know of other than using start(); in the init() or otherwise waiting until Monday.

I guess I should have added the caveat: "You can jury rig it using start(); in the init() and still get away with it in some cases - but only if you can't be bothered to wait until new ticks arrive, and be aware that problems can arise."

Reason: