Is there a way to loop a sound till user do something?, I mean a sound loop untill
user click ok, if there is a way to know if alert window is open it could be done
with that, but i could find any info.
- Setting an alert for a price evolution
- Who knows the solution (for loops / if statements)
- Questions from Beginners MQL5 MT5 MetaTrader 5
Here is a little sample of a way to do it:
Put this "indicator" on a chart. It is weekend right now so "refresh" the chart to make it work, or wait for ticks to come.
Every eight ticks/refreshes (roughly) it will raise an "alert" on screen, and sound on every tick until you delete the message.
#include <WinUser32.mqh> int start() { static bool SoundAlertOn = false; static int loopCount; if(ObjectFind("SoundLabel") == -1){ SoundAlertOn = false; } Comment("Loopcount = ", MathMod(loopCount, 8)); if(SoundAlertOn == false && MathMod(loopCount, 8) == 0){ SoundAlertOn = true; ObjectCreate("SoundLabel", OBJ_LABEL, 0, 0, 0, 0); ObjectSetText("SoundLabel", "DELETE ME TO STOP SOUND", 24, "Arial Bold", Red); } if(SoundAlertOn == true){ PlaySound("Alert.wav"); } loopCount++; }

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