Backtesting is a method for testing the effectiveness of a strategy and its parameters on historical price movement data. During the process, a trader can check how a strategy performed in the past, helping them decide whether to use that strategy in the future. The results provide a graphical representation of the strategy's transactions, a list of those transactions, and a set of statistical parameters that assist in making further decisions and optimizing the parameters.
⚠️ Important Note
Currently, only Binance Spot is supported for Backtesting. We’re working to expand this feature, and more exchanges will be added soon. Stay tuned for updates!
How to Access the Backtest Option
To use the Backtest feature, ensure you have enabled BETA mode and are using the new Advanced view of the DCA bot launcher. The Backtest option is not available in the "Classic" view.
Steps to Enable BETA Mode and Access the Advanced View:
You must enable the BETA testing mode to use our new DCA launcher!
Go to the Settings page and enable Beta-testing for this tool:
Navigate to the DCA bot launcher.
In the top-right corner of the launcher, select the Advanced view.
Look for the Backtest option within the configuration settings.
By enabling BETA mode and switching to the Advanced view, you can test your strategies with historical data for better insights and decision-making!
How to set up Backtesting
Step 1: Set Up Your DCA Bot
Before you begin backtesting, you must configure your DCA bot's parameters. This includes setting up the strategy parameters such as:
Base order size
Safety order size
Max safety orders count
Take profit (%)
Price deviation to open safety orders
Once the DCA bot is configured, you are ready to move forward to backtesting.
Step 2: Navigate to the Backtesting Feature
Go to the section labeled Backtest.
Choose the test period by selecting from the predefined options (3M, 6M, 9M, 1Y) or set a custom range.
Click the Start Backtesting button to begin.
Step 3: Running the Backtest
Once the backtest is initiated, you will see a progress bar indicating that the system is processing your request.
You can cancel the backtest during this period by clicking the Cancel button (shown as a small icon on the right of the progress bar). If canceled, you need to wait for one minute before you can initiate a new backtest.
During the backtest calculation, users can modify the parameters in the DCA form. In this case, there are two possible scenarios:
Cancel and Restart: Users can cancel the ongoing backtest by clicking the Cancel button, then wait for one minute before clicking Refresh Backtest to start a new test with the updated parameters.
Wait for Completion: Users can wait until the current backtest is completed. Once finished, two buttons will be available:
Show Details: To view the results of the completed backtest.
Refresh Backtest: To start a new backtest with the updated parameters.
If an error occurs during the backtest, you will receive a message to try again in 1 minute.
Step 4: Viewing Backtest Results
Once the backtest is complete, you will see the Show details button. Clicking on this will display detailed information about your backtest performance.
The details provided will include:
Equity: The total value of your account during the backtest, including both cash and the current value of held assets.
PnL (Profit and Loss): The net profit or loss from your strategy, based on all closed trades during the backtesting period. It represents the difference between total profits and losses.
Fees: The total transaction costs incurred during backtesting, including all commissions and exchange fees.
Volume: The total amount of assets traded throughout the backtesting period.
MDD (Maximum Drawdown): The largest drop from the highest to the lowest equity value during the backtest, indicating potential risk.
You can view the graphical representation of these trades on the chart.
Step 5: Interpreting the Chart
Each buy or sell point is marked with an icon:
Buy: Green
Sell: Red
When you hover over these icons, you’ll get additional information about the trade, such as the base order, safety order, take profit (TP), and stop loss (SL) levels.
The chart shows two main sections:
Price movement of the asset: This part of the chart shows the asset’s price action and your bot’s buy/sell points.
Cumulative PnL: The bottom section shows your strategy's performance over time, indicated by the change in PnL.
Step 6: Reviewing the Overview & Logs
The next important element of the backtest is the statistics that are generated from the test. Users can view a downloadable table that summarizes the transaction results based on historical data. Here are the key parameters in the table and their meanings:
PnL (Profit and Loss): The profit or loss made during the backtesting period, shown in both dollar value and percentage.
Backtest period: The duration of the backtesting process.
Deals closed: The total number of trades or transactions completed during the backtest.
Win Rate: The percentage of successful trades out of the total trades made.
Max. safety orders used: The maximum number of times the strategy averaged the price (using safety orders) within a single trade.
Average trade duration: The average time that each trade remained open.
Max. trade duration: The longest time a single trade was kept open during the backtest.
Maximum Drawdown: The largest decrease in your account's balance from a peak value before any recovery, showing the potential risk.
Average win trade: The average profit gained from successful trades.
Average loss trade: The average loss from unsuccessful trades.
Total fees: The overall transaction costs, including any commissions or exchange fees.
Slippage: The potential price difference between the expected price and the actual trade execution price.
Sortino Ratio: A measure of risk-adjusted performance, showing how well the strategy performed with downside risk taken into account.
Sharpe Ratio: Another risk-adjusted performance metric that shows how well the strategy performed considering the overall volatility of returns.
Standard deviation: A statistical measure that shows the variability in the returns during the backtest.
Trade Logs
Users can also view detailed logs of all trades conducted during the backtest. These logs will include:
Date and time: The exact date and time the trade occurred.
Type: The nature of the trade (e.g., Long or Short)
Pair: The trading pair involved (e.g., ETH/USDT, BTC/USDT).
Price: Average Buy/Sell Price
Volume: The amount traded in the transaction.
PnL: The profit or loss made of the deal
Step 7: Exporting Results
After reviewing the results, you can download the backtest overview and logs by clicking the Export Overview/Export Logs button at the top right. This will allow you to save your test results for future reference.