Hi Sync
Had this many times before look here
https://forum.mql4.com/9118
If you had searched you would have found many posts about detecting open of candle.

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
Can anyone tell me how can I know when a MT4 begins calculating data and switches to a timeframe ?
I want to reset my tick counter every time MetaTrader switches to the next bar or time frame?
thanks