Hi all !
Here is the backtest that I made, from the « RSI-2 Strategy » of Larry Connors.
He’s also the co-author of the « Cumulative RSI » Strategy.
It took me 5 minutes to write the code, as the rules are very simple : no need to detail them.
Even if the strategy is positive on many stocks, indices, I don’t find it that great.
But you are free to test it and why not improve it.
The picture shows the CAC40 for the last 20 years.
Best Regards,
DEFPARAM CumulateOrders = False
n = 2
// Conditions pour ouvrir une position acheteuse
MM200 = Average[200](close)
MM5 = Average[5](close)
RSI2 = RSI[2](close)
c1 = close > MM200
c2 = close < MM5
c3 = RSI2 < 10
IF c1 AND c2 AND c3 THEN
BUY n SHARES AT MARKET
ENDIF
// Conditions pour fermer une position acheteuse
c4 = close > MM5
IF c4 THEN
SELL AT MARKET
ENDIF
// Conditions pour ouvrir une position en vente à découvert
c1v = close < MM200
c2v = close > MM5
c3v = RSI2 > 90
IF c1v AND c2v AND c3v THEN
SELLSHORT n SHARES AT MARKET
ENDIF
// Conditions pour fermer une position en vente à découvert
c4v = close < MM5
IF c4v THEN
EXITSHORT AT MARKET
ENDIF