Relative Strength with Retrace

The strategy is a modified version of a Simple RSI strategy that uses two levels, a and b, for generating a buy signal, and two levels, c and d, for generating a sell signal.

To generate a buy signal, the strategy monitors the RSI and looks for a fall to a specified level (a=20) followed by a recovery to a higher level (b=30). This indicates a potential reversal or correction in the stock's price trend, and a buy signal is generated.

To generate a sell signal, the strategy monitors the RSI and looks for a rise to a high level (c=90) followed by a fall to a lower level (d=80). This signal helps to stay in a long position during an upward trend and avoid selling too early.

Simple RSI strategy based on the absolute values of the index has one disadvantage. It is generating buy signals sometimes too early. If a stock is on a log downward trend RSI may reach a buying level but a sell signal will be generated when the price has already reached a low price. To avoid that this strategy does the following:
it generates a buy signal when RSI has fallen to some level a and has recovered to a value b which is higher than a.
A sell signal is generated when RSI has reached a high level c and has fallen from it to a lower level d. An advantage of sell signal is that it helps to stay in long position during a long upward run.
In the presented example a=20;b=30,c=90,d=80.

Formula

IF RSI(m) > v AND RSI retraced to v'
THEN GO SHORT
ELSE
IF RSI(m)< w AND RSI retraced to w'
THEN GO LONG
where RSI is relative strength index;
m is RSI periods;
and v > v' > w' > w;
e.g. v = 80; v' = 70; w' = 30; w = 20