I can not help you but may give some links to Codersguru article and the threads where people were thinking about it aready:
- Alert once: https://www.mql5.com/en/forum/172885
- Alerts: many functions and examples https://www.mql5.com/en/forum/173092
- Easy iCustom and Alerts: https://www.mql5.com/en/forum/173589
- How to alert only at candle close: https://www.mql5.com/en/forum/general
Thanks a lot... that gaves me the needed hint

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
Hi,
i use a bar close timer which prints for example 1:45 (means 1 Min (m) 45 Sec (s) left until bar close).
What I'm trying to do is play once a sound if m<1 && s<40 for example. Two problems
1) MetaTrader only changes the bar close timer if there is a price printed
-> Ok, not good but I can live with that!
2) The code I have now is something like this
...so I get this sound alert for every price printed in that 40 seconds period.
How can I check if there was already a sound alert in that 40 seconds period, if yes don't play a sound again until next bar starts (m>1)?
Thanks