Trouble with Alert

 

Hi,


I'm having trouble creating an indicator that alerts me at the proper time.


Goal: To have an indicator that sends and alert and places an arrow on the chart at the exact time that the alert occurs. Only one alert message should be sent.


I'm working on creating a stochastic intersection indicator and I've looked at the example found at https://www.mql5.com/en/articles/1448 . Based on this example, an alert will be issued in the period after the intersection. For example, say my intersection is at a value of 50. In period 1, the stochastic is at say 49, sometime in period 2 the stochatic touched 50 and closed at a value of 70. At the open of Period 3, an alert will be issued saying that there was an intersection. Unfortunately, the indication comes too late for my use and I would like to be alerted at the exact time that the intersection occured. I've looked at other examples such as fractals, which display arrows in real time but if I add an alert to something like this, I get a stream of alerts and not just one single alert.


Does anyone know how I can handle this situation and/or have sample/example code that I can look at?


Much thanks

Reason: