RSI Computation

Aarav Sawlani

New Member
Hi everybody,

I am having an error in computing RSI in a Python backtest. My goal is to calculate the RSI of a bar when it comes in and add it to a list of RSIs. Then, simulate a cross from overbought --> normal by coding (ListOfRSIs[-2] >= 70 and ListOfRsis[-1] < 70]. There is no syntactical error in my code, but for some reason, I'm only getting one trade on SPY data from October 1st 2019 to November 15th 2019. I've looked at the chart, and it performs this cross numerous times. Please help! (Once again, this is in python code.)