TRSI alert coding help

 

Hello,

I am trying to add a popup alert to the TRSI indicator and have run into an issue.

My goal is to send the alert when the Gray line RSI[0] crosses the Red lineTRSI[0].

It seems to work fine except when both values hover near each other, and cross back and forth

fractionally in low market volitility. I keep getting frequent repeated alerts in this market condition.

Can anyone suggest a way to limit cross up and cross down alerts in this condition? I am basically

trying to eliminate frequent alerts. I would like this to work in a similar fashion to the sMACD

posted here if possible. Here is the base code to the indicator is attached without any alert logic:

Thanks,

J

Files:
trsi.mq4  6 kb
 
jbfajkow:

Hello,

I am trying to add a popup alert to the TRSI indicator and have run into an issue.

My goal is to send the alert when the Gray line RSI[0] crosses the Red lineTRSI[0].

It seems to work fine except when both values hover near each other, and cross back and forth

fractionally in low market volitility. I keep getting frequent repeated alerts in this market condition.

Can anyone suggest a way to limit cross up and cross down alerts in this condition? I am basically

trying to eliminate frequent alerts. I would like this to work in a similar fashion to the sMACD

posted here if possible. Here is the base code to the indicator is attached without any alert logic:

Thanks,

J

You will have to use previous values from the current. Not sure what your time frame is, the faster the time frame, the better this option works. If you are using 5M, then using previous value is still good. But if you are using 1D, then using the past is obviously not ideal. But in general you will get this all the time when you want to develop a crossover system. But try the following


Gray line RSI[1] crosses the Red lineTRSI[1]
Reason: