OnTimer

 

Hi coders, 

Can I ask, is all codes written inside OnTimer can be executed if the price got freezed (OnTick is not running cause no tick data coming) ? Thanks

 
Donna Citra Setiadi:

Hi coders, 

Can I ask, is all codes written inside OnTimer can be executed if the price got freezed (OnTick is not running cause no tick data coming) ? Thanks

Yes it can execute without any problem.
 

What do you mean buy price got freezed?

Market Closed or no internet connection?

 
Donna Citra Setiadi:

Hi coders, 

Can I ask, is all codes written inside OnTimer can be executed if the price got freezed (OnTick is not running cause no tick data coming) ? Thanks

Yes It must. but  there have been reports of OnTimer() occasionally ceasing to function under certain conditions, such as:
Infinite loops or blocking operations within the OnTimer() function.
Resource-intensive tasks that hinder the EA's responsiveness.
Issues related to the MetaTrader platform or VPS environment.

 
Donna Citra Setiadi:

Hi coders, 

Can I ask, is all codes written inside OnTimer can be executed if the price got freezed (OnTick is not running cause no tick data coming) ? Thanks

When too many ticks come in rapidly and there is no open position, it sometimes opens two consecutive trades. To prevent this, I use OnTimer()