๐ŸงชModule Backtesting

Backtesting is the process of testing your trading module and its underlying strategy using historical data. This is done by simulating the execution of the strategy using past market data and then evaluating the performance of your module based on the results. Backtesting allows you to see how a module would have performed in the past and can help identify potential shortcomings and areas for improvement. It is an essential tool for evaluating the effectiveness of your module, but it is not a perfect solution and has limitations that should be taken into account when interpreting the results.

Before you deploy your module, we recommend you test the underlying strategy to evaluate its effectiveness. This will provide you with insights into trade profitability and other relevant metrics, which you can use to fine-tune your modules.

Please keep in mind that past performance does not indicate future profitability. Be sure to always adjust your modules to current market conditions.

How to backtest a module?

To run a backtest, navigate to Backtesting in your navigation panel. Then click on โ€˜+ Create Backtestโ€™ to create your first backtest.

Start by selecting a module to backtest. If your module is part of an algorithm, the backtest will evaluate the dependencies between modules but will only display the performance of your selected module (including its sub-positions).

Next, specify a balance for your module. This is the amount of money youโ€™d like your module to use in your backtest.

Choose a backtesting period for which youโ€™d like to backtest your module. A backtesting period is the specific time range used when conducting a backtest of your trading module. The period is essential because it determines the amount of data that will be used in the backtest, which in turn affects the reliability and accuracy of the results. It is important to choose an appropriate backtest period that is long enough to provide a fair assessment of your trading strategy but not so long that it becomes outdated and no longer relevant to current market conditions.

As we are in the alpha stage of development, there is currently a constraint to how far back you can backtest your modules. This is the maximum amount of data that can be used when testing your module using historical data. The limit is 50,000 candles and is calculated based on the smallest timeframe used in your moduleโ€™s conditions.

Say you have a module that has multiple entry and exit conditions with varying timeframes (candles). If your moduleโ€™s conditions are evaluated on 1 min, 15 min, and 1h timeframes, your smallest timeframe is 1 min. Subsequently, the backtest will be limited to 50,000 1-minute candles, i.e., you can backtest your module over 50,000 minutes (35 days).

Alternatively, if you have conditions that are evaluated on 1h, 2h, and 4h timeframes, your smallest timeframe, in this case, would be 1h. You can backtest your module over 50,000 hours (2083 days).

For some trading pairs, there may be a cut-off time that is less than 50,000 candles as historical data for certain trading pairs on Binance is not available past a certain date. As a result, your module will be backtested as far back as Binance's historical market data is available.

Please keep these constraints in mind when setting up your backtests.

With your backtesting period selected, next, choose if you want exchange fees included in your backtest.

Finally, click on โ€˜Runโ€™ to start your backtest.

Depending on the complexity of your module and its underlying strategy, it may take up to a couple of minutes to complete your backtest. Once the backtest is completed, click on it to view the results.

Please note that backtesting has the following limits:

  • You can only run 1 backtest at a time

  • There is a 5-minute cooldown before you can run a new backtest

  • Only the 5 most recent backtests are stored

Last updated