I've been reading mql4 documentation, but I still don't understand this well. If I set the period to one hour, does ontick event run every second as the name tick indicate or does ontick even run every hour as I set in the period? Sorry for the stupid question, I'm not really good at this.
- Real and Generated Ticks - Algorithmic Trading, Trading Robots
- Volumes - Volume Indicators - Technical Indicators - Price Charts, Technical and Fundamental Analysis
- Volumes - Volume Indicators - Indicators - Charts - MetaTrader 5 for Android
Erland Devona:
I've been reading mql4 documentation, but I still don't understand this well. If I set the period to one hour, does ontick event run every second as the name tick indicate or does ontick even run every hour as I set in the period? Sorry for the stupid question, I'm not really good at this.
I've been reading mql4 documentation, but I still don't understand this well. If I set the period to one hour, does ontick event run every second as the name tick indicate or does ontick even run every hour as I set in the period? Sorry for the stupid question, I'm not really good at this.
Ticks are independent of time. A tick is a price change. You can have 0 ticks in a second, or you can have hundreds (during high volatile activity).
OnTick() is an event that occurs when a new tick comes in from the broker. If no tick comes in, OnTick() does not execute.
When you set the chart period to H1, you see bars (or candles) that are 1 hour long.
If you want an event when a bar finishes, that can be done, but you have to write it yourself. Lookup IsNewBar in this forum for details.
If you want an event to occur at exactly every hour, you can use the OnTimer() event, which is time-based, not tick/price based.
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