Here an example:
datetime Alert_1; if ((Bid > SoundWhenPriceGoesAbove) && (SoundWhenPriceGoesAbove > 0 && TimeCurrent() > Alert_1)) { PlaySound("alert.wav"); //Alert(Symbol(),Period()," Price above ",SoundWhenPriceGoesAbove); //ObjectCreate("PriceUpLevel", OBJ_HLINE, 0, Time[0], SoundWhenPriceGoesAbove); //ObjectSet("PriceUpLevel", OBJPROP_STYLE, STYLE_SOLID); //ObjectSet("PriceUpLevel", OBJPROP_COLOR, Magenta); //ObjectSet("PriceUpLevel", OBJPROP_WIDTH, 1); //SendMail("Price for " + Symbol() + " above the alert level " + Bid, "Price for " + Symbol() + " reached " + Bid + " level, which is above your alert level of " + SoundWhenPriceGoesAbove); //ObjectDelete("SoundWhenPriceGoesAbove"); //SoundWhenPriceGoesAbove = 0; Alert_1 = TimeCurrent() + 5; // 5 = 5 seconds delayed }
d.saravana21: #property indicator_chart_window
qjol:
Sleep
honest_knave: If you're using an indicator, sleep won't work.
Definitely an indicator.
- Use Frenchy's approach (for a repeating signal while market above level.) Or
Don't check for levels:
if ((Bid > SoundWhenPriceGoesAbove) && (SoundWhenPriceGoesAbove > 0))
Check for a change in conditions. static bool isCondition = false; bool wasCondition = isCondition; isCondition = (Bid > SoundWhenPriceGoesAbove && SoundWhenPriceGoesAbove > 0); if (!wasCondition && isCondition) ...
Will alert one time each time market moves up through level.Or disable the level after the alert if ((Bid > SoundWhenPriceGoesAbove) && (SoundWhenPriceGoesAbove > 0)){ SoundWhenPriceGoesAbove = 0.0; // One Alert
One alert only

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
Dear Friends. I got a code alert Horizontal line. but i could not make it as wait for 5 seconds after each and every alert..
Here is the code.
Kindly some one help me.. Thanks in advance