MQL5 - onTimer does not run

 

Hi 

I have created a barebones EA to test onTimer and it does not seem to run the code inside the onTimer function.

Here's the code:

//+------------------------------------------------------------------+ //| JJ-Test-onTimer.mq5 | //| Copyright 2024, Juan Guirao | //| | //+------------------------------------------------------------------+ #property copyright "Copyright 2024, Juan Guirao" #property description "Simple test of onTimer function" #property version "1.00" int OnInit() { Print("onInit"); bool setTimerSuccess = EventSetTimer(1); Print("setTimerSuccess: ", setTimerSuccess); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { EventKillTimer(); Print("Expert Advisor Removed"); } void onTimer() { Print("onTimer"); datetime tradeServerTime=TimeTradeServer(); Print(tradeServerTime); }

Here's the output I am getting in the Experts tab.

Note about 13 seconds have elapsed since onInit was executed until the removal of the EA.

However, onTimer is not printing anything.

onTimer does not print anything


Any ideas or suggestions?

 
"OnTimer" is correct not "onTimer"(Higher case 'O').
 
Yashar Seyyedin #:
"OnTimer" is correct not "onTimer"(Higher case 'O').

Thank you Yashar.

Of course!

Being a software developer I feel really stupid to have missed that! 🤦🏻‍♂️