No.
But if need be you can
//+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- create timer EventSetTimer(60); // seconds //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- destroy timer EventKillTimer(); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- OnTimer(); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--- Print("Hello World!"); } //+------------------------------------------------------------------+
Marco vd Heijden:
And it will print "Hello World!" every tick.
No.
But if need be you can
thomas2004: My EA uses a Timer. It should print out "Hello World" every minute. I run this on demo live and it does as what I want. But as I back testing it, it will not print out any thing. I wonder if the EvenSetTimer() could be back tested.
OP is asking does the timer work in the MT5 tester. It doesn't in MT4:
See In
backtest OnTimer() not performs (M. Ali) - MQL4 and MetaTrader 4
- MQL4 programming forum and work around Chart
Event For MT4 Backtester (Migel) - MQL4 and MetaTrader 4 -
MQL4 programming forum

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
My EA uses a Timer. It should print out "Hello World" every minute. I run this on demo live and it does as what I want. But as I back testing it, it will not print out any thing. I wonder if the EvenSetTimer() could be back tested.