Addind Alerts

ogwedhi

Trader
Apr 8, 2021
12
2
9
41
Hi,
I'm trying to add alerts to a line indicator. When it turns white it should read possible trend change, blue for buy and gold for sell. Its kinder working but is giving alerts every so often. How can i reduce the number of alerts, not every candle stick but like every 2 to five ins or so.

How can I achieve this effectively?

Regards,
Flavia
 

Attachments

  • GBalliance.mq5
    21.8 KB · Views: 9

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
valc[] is a color buffer for the indicator's line. If you want alerts on the color change than you have to checking that the current valc value is different from the previous one instead of checking the atr[] buffer, which you don't need at all.
 

ogwedhi

Trader
Apr 8, 2021
12
2
9
41
Thanks for the response. I have done some changes but I'm still not getting the desired result. This one is a challenge to me. Its also still giving an alert very often.
 

Attachments

  • FM_GBalliance.ex5
    19.6 KB · Views: 4

ogwedhi

Trader
Apr 8, 2021
12
2
9
41
Hi. Sorry about that. Attached find the correct file
 

Attachments

  • FM_GBalliance.mq5
    21.8 KB · Views: 11