Agent86: 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 ?
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.
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.
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
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