fatbody: How to call a function after each 45 second? Period of call function = 45 second
Read about the OnTimer() Event Handler: https://www.mql5.com/en/docs/basis/function/events

Documentation on MQL5: Language Basics / Functions / Event Handling Functions
- www.mql5.com
Language Basics / Functions / Event Handling Functions - Reference on algorithmic/automated trading language for MetaTrader 5
Hi fatbody,
I created it for you, and I hope you can try this :)
input int interval=45; //--Interval in seconds //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { EventSetTimer(interval); //-- if you want to use milliseconds then you can use : //-- EventSetMillisecondTimer(interval); //-- and interval is 1000 for each 1 second. //-- Example for 0.5 second, then you set interval is 500 return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- destroy timer EventKillTimer(); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--do something here ... }
Good luck.

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
How to call a function after each 45 second?
Period of call function = 45 second