DanielNobbe / Forex

0 stars 0 forks source link

List steps to implement backtesting.py #39

Closed DanielNobbe closed 3 years ago

DanielNobbe commented 3 years ago

https://kernc.github.io/backtesting.py/ Figure out which steps need to be taken to integrate this backtesting script into our system.

DanielNobbe commented 3 years ago

Backtesting requires a few things:

As such, we need to take the following steps:

  1. 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.
  2. 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.
  3. Write main script for backtesting. Pretty straightforward. Should be similar to main.py, but use the backtesting engine instead of scheduling jobs
  4. Write some code to load or convert history into required pandas dataframe format.