Skip to content
All library documents

Configuring and Evaluating Strategy Backtests in Hummingbot

Article Hummingbot docs

Summary

The document explains how to configure and run a historical backtest in the Hummingbot Dashboard. Users select a controller, exchange connector, trading pair, and strategy parameters such as leverage, quote allocation, position mode, order levels, spread, and order sizing. They then choose a date range, data resolution, and trade cost before running the simulation. The example uses a simple market-making controller on a crypto pair.

Reported outputs include net profit and loss, maximum drawdown, traded volume, Sharpe ratio, profit factor, position counts, directional accuracy, closure types, and charts of price and profit over time. The guide also describes saving a named, tagged configuration for later deployment. These metrics help inspect historical behavior, but the document does not explain the simulator's assumptions, data quality, fee or slippage modeling beyond a trade-cost input, or out-of-sample validation. Historical results therefore provide a configuration review, not assurance of live performance.

Key ideas

  • Backtests require a configured controller, connector, trading pair, and order parameters.
  • Users set the historical date range, resolution, and trade cost before running a simulation.
  • Performance outputs include returns, drawdown, volume, Sharpe ratio, and profit factor.
  • Charts and close-type counts provide additional views of strategy behavior.
  • Saved configurations can be tagged and made available for deployment, while historical results remain limited by simulator assumptions.

Tags

Full text
# Backtesting Strategies


# Backtesting Strategies

The **Backtesting** section in the Hummingbot Dashboard is a powerful tool available on all controller pages, allowing users to evaluate the performance of their trading strategies using historical market data. 

This feature provides crucial insights into how a strategy would have performed in the past, helping users refine and optimize their configurations before deploying them in a live trading environment.

## Strategy Configuration

- Before backtesting a strategy, you need to configure it. In this example, we'll use the **PMM Simple** controller with the **Binance** connector, trading the **BTC-USDT** pair.

![Configuring the PMM Simple controller for backtesting](backtest-1.png)


- **Select Connector:** Choose the exchange (e.g., Binance).

- **Select Trading Pair:** Specify the pair to trade (e.g., BTC-USDT).

- **Set Parameters:** Configure leverage, total quote amount, position mode, and other relevant parameters.

- **Order Settings:** Define buy and sell order levels, spread, and amount distribution.


## Run Backtesting

- With your configuration set, navigate to the backtesting section. Specify the **Start Date** and **End Date** for the historical data, the time interval for the **Backtesting Resolution**, and the **Trade Cost** percentage. Click the **Run Backtesting** button to initiate the process.

![Backtesting results showing net PNL, max drawdown, and total volume](backtest-2.png)


- The backtesting results will generate in a few seconds, providing you with a comprehensive overview. Here's an example of what you might see: 

![Graphical representation of backtesting results including candlestick chart and PNL quote chart](backtest.png)

**Backtesting Metrics**:

  - **Net PNL (Quote)**: The net profit and loss in the quote currency.
  - **Max Drawdown (USD)**: The maximum loss from the peak during the backtesting period.
  - **Total Volume (Quote)**: The total trading volume in the quote currency.
  - **Sharpe Ratio**: A measure of risk-adjusted return.
  - **Profit Factor**: The ratio of gross profit to gross loss.
  - **Total Executors with Position**: Number of executors that had open positions during the backtest.

**Accuracy Metrics**:

  - **Global Accuracy**: The overall accuracy of the strategy.
  - **Total Long & Short**: Number of long and short positions taken.
  - **Accuracy Long & Short**: Accuracy percentages for long and short positions.

**Close Types**:

  - Metrics for different types of order closures such as `TAKE PROFIT`, `TRAILING STOP`, `STOP LOSS`, `TIME LIMIT`, and `EARLY STOP`.

**Graphical Representation**:

  - **Candlestick Chart**: Visualizes price movements of the trading pair over time.
  - **PNL Quote Chart**: Shows the profit and loss over time.

- You can return to the configuration page to make adjustments and re-run the backtesting as needed. Once satisfied with the results, you can upload the configuration for deployment. 


## Upload Config to Backend API

![Uploading the configured strategy to the backend API](backtest-3.png)

- Create a name for the current config

- The Config Tag is similar to a version number which allows you to track changes made to the strategy config later on. 

- Click the **Upload** button to save the configuration. This makes it available on the **Deploy V2** page, where you can create instances based on the saved configuration.

Shown in full with attribution under the source's licence. Licence: Apache-2.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.