We can store certain values in the backtesting loop as Indicators. These can then be plotted throughout the backtest, which allows us to keep track of the predictions.
This does require some reworking of our Strategy implementation, since the Indicators functionality in backtesting.py repeatedly computes the indicators outside of the main function. This means that we need to pass the model to backtesting.py in some way.
See the quick start guide for more info: https://kernc.github.io/backtesting.py/doc/examples/Quick%20Start%20User%20Guide.html
We can store certain values in the backtesting loop as Indicators. These can then be plotted throughout the backtest, which allows us to keep track of the predictions. This does require some reworking of our Strategy implementation, since the Indicators functionality in backtesting.py repeatedly computes the indicators outside of the main function. This means that we need to pass the model to backtesting.py in some way. See the quick start guide for more info: https://kernc.github.io/backtesting.py/doc/examples/Quick%20Start%20User%20Guide.html