I am trying to backtest a momentum strategy using Backtesting.py. I've gathered the data and computed indicator values using pandas_ta. I've defined short and long trading conditions. Now I just need Backtesting.py to run a backtest so that I can determine the performance of my strategy on historical data.
This notebook contains all the code plus the errors I am getting:
The latest error is this one:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I've googled this type of error and tried to resolve it using parentheses, bitwise (and) and logical (and). I don't think my truth statement is illegal in Python but I could be wrong. I've also read Backtesting.py's documentation to understand the framework as best I can.
Any help would be appreciated.