
- www.mql5.com
- Please HELP! How to make PlaySound for alert only make a sound 3 times per candle not on every tick?
- Help!!!!!!!!!!! Sound Alert Needed.
- Indicators with alerts/signal
Hi,
i have tested your code in my environment and it works fine - but the sound is played
every tick and thats very often :-) I have modifyed your code a little and now the sound
is played only on a new bar.
if (prev_calculated < rates_total) { double pHigh=iHigh(_Symbol,_Period,1); double pLow= iLow(_Symbol,_Period,1); if ((pHigh-pLow)>0.01) { PlaySound("email.wav"); } } return rates_total;
If this dosen't work you should check if the soundfile exists at the right place (Sounds subdirectory in the
metatrader installation direcotry) and you can play it manually.
Hi,
i have tested your code in my environment and it works fine - but the sound is played
every tick and thats very often :-) I have modifyed your code a little and now the sound
is played only on a new bar.
If this dosen't work you should check if the soundfile exists at the right place (Sounds subdirectory in the
metatrader installation direcotry) and you can play it manually.
Thank you very much for your reply.
Yes, it was due to misplaced sound file. Thank you for improved code too.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use