ontick event and period

 
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.
 
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.

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.