Question about OnTick during closed hours.

 
Hi, 

I wanted to confirm that I understand the OnTick function for EAs

I assume when the market is closed then there is no tick data ? 
If so then I should get no object or event data for code listed in the OnTick code block ?

Including Comments or Print right ? 

Please confirm thanks 

 
 
Agent86I wanted to confirm that I understand the OnTick function for EAs. I assume when the market is closed then there is no tick data? If so then I should get no object or event data for code listed in the OnTick code block? Including Comments or Print right ?  

When there are no new ticks arriving (e.g. weekend), then the OnTick() event handler is never called and anything you do in there is ever executed until a new tick arrives.

However, the other event handlers such as OnTimer() or OnChartEvenet() can still be triggered by the Timer or user Chart interaction, even when no new tick data arrives.

 

Yes. OnTick is useful to handle real time data, as well as OnCalculate in indicators, except that OnCalculate is called once after OnInit. Anything else you can add to OnTimer, OnChartEvent, etc.

https://www.mql5.com/en/docs/event_handlers/ontick

Documentation on MQL5: Event Handling / OnTick
Documentation on MQL5: Event Handling / OnTick
  • www.mql5.com
OnTick - Event Handling - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Perfect, Thanks to ALL.