Running Backtests

Overview

Once a strategy is created, the developer can verify its performance by running backtests on it. Backtests track historical market data to see how the strategy would have performed had it been trading at the time. Backtest results help gauge how successful a strategy might be in the future, but as with most investments, past performance cannot guarantee future returns.

Backtests start in January 2020 and run to the latest oracle round for the strategy’s underlying asset. Initially, backtests won’t be customizable. Towards the end of phase 1, users can change parameters of the backtest, such as start/end date, profit target, stop loss, and underlying asset. To maintain a consistent performance metric across published strategies, submitted strategies must have at least 1 backtest with default start date. Once a strategy is published, or submitted for review, it can’t be modified (for now).

Backtests are performed on a centralized server using historical price feed updates from the strategy asset’s Chainlink oracle. Once a strategy is published, livetest results for the strategy are collected from emitted blockchain events whenever the strategy’s trading bot makes a trade.

How to Run a Backtest

To get started, head to https://www.tradegen.io/settings and find the 'My Strategies' section.

If a strategy hasn't had a backtest performed yet, a wrench icon will appear under 'Actions'. Click the wrench icon to display the following modal:

Click the 'Yes' button to proceed with the backtest. This will run the backtesting script, which can take 15 seconds to 2 minutes to complete depending on how many entry/exit rules the strategy has.

Viewing Backtest Results

To view the backtest results, click the 'timeline' icon under 'Actions'. You'll be routed to the Strategy Info page:

These are some of the stats you'll find:

  • Sharpe Ratio: The ratio describes how much excess return you receive for the extra volatility you endure for holding an asset. Higher values indicate higher expected returns relative to the risk.

  • Alpha: Compares the strategy's average monthly performance to the average monthly return from holding the underlying asset, while penalizing strategies with a high trade frequency. A positive Alpha indicates the strategy is expected to perform better than simply holding the asset.

  • Max Drawdown: Measures the largest pullback from a high. This gives users an idea of how large the losses can be if they decide to hold through a pullback.

Towards the bottom of the page, you'll find a chart showing the strategy's backtest performance since January 1, 2020:

Viewing Transaction History

To view the strategy's transaction history, click the 'View Transactions' button near the top of the Strategy Info page. This will take you to the History page:

This page shows the entry/exit time, entry/exit price, symbol, position size, and ROI of each trade the strategy made during the backtesting period.

Last updated