Download MetaTrader 5
To add comments, please log in or register
Thousands of developers have already published their products in the Market. Join them!
Mohammad Ali
18095
Mohammad Ali 2014.02.19 16:37 

Dear Guys

I write a code on OnTimer() . EA open trade on time. so i write this code on there. but when i try to backtest this EA all code within OnTimer() not work. How can i do some thing that OnTimer() code work on backtest.

Thanks.

Alain Verleyen
Moderator
28536
Alain Verleyen 2014.02.20 18:12  
capilta:

Dear Guys

I write a code on OnTimer() . EA open trade on time. so i write this code on there. but when i try to backtest this EA all code within OnTimer() not work. How can i do some thing that OnTimer() code work on backtest.

Thanks.

What is the meaning of "not work" ? Not executed or you don't get the expected results or ... ?
Mohammad Ali
18095
Mohammad Ali 2014.02.21 02:34  
angevoyageur:
What is the meaning of "not work" ? Not executed or you don't get the expected results or ... ?


All the code within OnTimer() not executed.
Slawa
Moderator
6676
Slawa 2014.02.21 06:13  
OnTimer, OnChartEvent processing not implemented yet in the Tester
ffoorr
983
ffoorr 2014.02.25 14:10  
So the OnTimer(), work or don't work in the tester ?
Alain Verleyen
Moderator
28536
Alain Verleyen 2014.02.25 17:07  
ffoorr:
So the OnTimer(), work or don't work in the tester ?
The answer from stringo is very clear. OnTimer don't work in the Strategy Tester.
michael
65
michael 2014.03.22 12:07  

in addition to stringo's information, does anyone know when OnTimer and OnChartEvent will be implemented in the Tester? Even an target implementation date / time period would be helpful.

Many thanks for any advice.

toriachtmql
52
toriachtmql 2015.09.30 13:40  
chaeljc:

in addition to stringo's information, does anyone know when OnTimer and OnChartEvent will be implemented in the Tester? Even an target implementation date / time period would be helpful.

Many thanks for any advice.

+1 for this. Any implementation plans?
NickF
31
NickF 2016.05.29 04:28  
It would  be nice to be able to run the backtester with code in OnTimer() function - some brokers only provide trading with MQL4, not with MQL5. 
whroeder1
13602
whroeder1 2016.05.29 14:30  
Toriacht: Any implementation plans?

The tester doesn't run in real time, you can speed it up (32x,) and you can pause the creation of ticks and you can skip all ticks for a bar. How should the period of OnTimer change for those three scenarios?

Not likely to every run in the tester. Just check in OnTick for the tester and do the functionality. Same as Chart Event For MT4 Backtester (Migel) - MQL4 forum

enum Terminal_Mode{  MODE_LIVE, MODE_VISUAL, MODE_OPTIMIZER};
/// @returns terminal mode.
Terminal_Mode     get_modus_operandi(void){
   if(!IsTesting() )          return MODE_LIVE;
   if( IsVisualMode() )       return MODE_VISUAL;
                              return MODE_OPTIMIZER;
}
/
To add comments, please log in or register