A Pandas Dataframe for the time series, with Open, High, Low and Close values (optionally Volume), and timestamps (datetime) plus more columns that are available to the strategy (could use those to store the tensors for input into model?)
A strategy object that handles the trades. See here for more info. It requires the usage of some special functions to track certain values, and to make trades. Also note the "Indicator" object that wraps functions -- it keeps track of the current timestep and always uses the corresponding index as index 0 for indicators. (earlier indices then become -1, -2 etc, later indices 1, 2, etc)
As such, we need to take the following steps:
Create a strategy object that works similarly to our Interpreter. Ideally, this would inherit most methods from the Interpreter, so that we only need to make changes to the strategy in a single place. To inherit all necessary methods, it might be necessary to modify the Interpreter as well. Note that if we don't use inheritance, this would require us to change the trading strategy in two places for every single change, which is very prone to bugs and does not allow for testing these changes properly.
Write code that converts pandas rows into something the predictor can use. This can also be done by incorporating extra info into the original dataframe, but we will still need some form of interface.
Write main script for backtesting. Pretty straightforward. Should be similar to main.py, but use the backtesting engine instead of scheduling jobs
Write some code to load or convert history into required pandas dataframe format.
https://kernc.github.io/backtesting.py/ Figure out which steps need to be taken to integrate this backtesting script into our system.