Backtesting
Backtesting on the Deno Runtime
Botmain allows you to backtest and forward-test your strategy on historical and live-streaming data. Your strategy code executes in the
Botmain strategies run in a sandbox with no I/O access by default, allowing you to safely use thousands of modules from the NodeJS ecosystem without worrying about malicious code accessing your filesystem. External modules are categorically unable to access your secret keys, which are kept encrypted on your computer and nowhere else.
Running a backtest
- Select your module folder:
- Click the "Select a module" button and select the folder containing your strategy classes

Botmain will load up your classes and you will see them in the dropdown

- Open Run Settings:
- Click the "Run Settings" button to open the run settings modal where you can specify various parameters for your strategy run.

- Set general run parameters
- Select your strategy class, date range for the backtest, and initial run speed. (You can adjust the run speed while the strategy is running.)

Set markets to trade and accounts to trade with
Each market can trade on a different account. For simulation accounts, this is normally not needed since you can use the same simulator account across all exchanges. In that case, we just use the same account for both markets:
This example assumes a funded simulator account. To fund your simulator account see
Accounts

Set Module Inputs
Botmain identifies any
@Parameter()
decorated properties on your strategy class and allows you to provide values for them through the GUI. This includes@Parameter()
decorated properties on all@Inject()
decoratedIndicators recurisvely.See
Parameters for more information

- Run your backtest and monitor your portfolio analytics in real-time