I would be very grateful if someone could point out where i'm going wrong
with my adding alert attempt. It works, but i'm getting repeating alerts
for the same action, i just want the one alert. grrrr
thank you kate
// Up Arrow Alert
if ((chL_BuferUp[TriggerCandle] > 0) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != 1))))
Text = AlertText + " @ lows : " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - LONG";
if (EnableNativeAlerts) Alert(Text);
if (EnableSoundAlerts) PlaySound(SoundFileName);
LastAlertDirection = 1;
// Down Arrow Alert
if ((chH_BuferDn[TriggerCandle] < 0) && ((TriggerCandle < 0) || ((TriggerCandle == 0) && (LastAlertDirection != 1))))
Text = AlertText + " @ highs : " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - SHORT";
LastAlertDirection = -1;
No one can help you because no one sees your entire code. But I guess your conditions are met repeatedly within a candle. Focus on these two lines.
datetime TimeOfLastAlert, TimeOfNewAlert;
Give these things some values.
Time of candle open or close it should be.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.