• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

RSI Computation

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.)