Backtesting & backfilling events
Cyborg can also be used to analyse historical events by backfilling a flow. Although slightly more technical than live analysis, we have attempted to make the process easier using a Jupyter Notebook. We aim to CSV uploads as a feature in the near future.
For now, a link to our example Jupyter Notebook can be found here.
Note: For the technically minded, feel free to write your own code to backfill your flow, following the POST request format described here.
CSV format
Cyborg requires only that the CSV file you use contains the following rows:
- datetime (see see allowed datetime formats)
- prediction (1 for buy, -1 for sell)
Running the code
To run the code and backfill your events, there are a couple of parameters that need to be filled in:
path_to_csv
- The filepath of your CSV fileticker
- The ticker of your tradeswebhook_url
- The webhook of your flow (see here to learn how to find your webhook)cost_pct
- Cost to trade (leave as 0 unless you want to customize this)benchmark_ticker
- (Optional) The ticker you wish to benchmark against
Once these are filled in, you can download the Jupyter Notebook and run locally with your CSV file, or upload the CSV and run on the server.
After a minute or two, you should see your events populated in the Cyborg homepage. After a while, the analysis will also be populated but please note this may take an hour or so depending on your Cyborg plan and the load on the system.
For a Walkthrough example of backtesting a research question