Hi guys,
I wanted to test a simple RSI 2 periods strategy :
- Buy when the RSI is below 10 and the price > its SMA 200
- Sell when the RSI is above 80
I just tested that on the SPY
The problem is that when I checked the logs, I invest even when the RSI is above 10 for example on the 2011-02-24, the RSI was at 12.8929842633 and I invested in the asset.
Please find the backtest attached, does anyone knows what is wrong with my code?
Thank you so much for the help