I'm having a couple of issues with RSI so plan to post two backtests.

This one is straightforward.  It adds SPY as an equity and defines a 14 day RSI.  On an EOD routine it logs the price and RSI value. 

Note the negative RSI values around 12/24 and the value over 100 on 1/22.  The range for RSI is 0-100 so how can this be?   Is there something wrong with the way I am defining it?

 

 

Author