Skip to main content
Backtesting simulates your strategy against historical exchange data. Use it to understand parameter sensitivity and validate that your strategy behaves as expected—not to predict exact live results.

Philosophy

Backtesting market making strategies cannot perfectly simulate reality:
  1. Queue Position — Order books are FIFO (First In, First Out). You never know your position in the queue because exchanges don’t reveal participant order positions.
  2. Path Dependency — If one fill differs between backtest and live, all subsequent behavior diverges. The correlation breaks with a single mismatched order.
  3. Order Book Opacity — Thick order books (like USDT/BRL with $600K at the first level) mean your orders may never fill even if price touches your level.
Don’t trust absolute P&L numbers from backtests. Use backtesting as a parameter research tool, not a prediction engine.

What Backtesting Is Good For

Supported Executors

The backtesting engine works with controllers using these executors:

Candle Resolution

One-second candles are crucial for market making backtests. With one-minute candles, the engine can only simulate one fill per minute. Real market making often has 30+ fills per minute. One-second resolution captures the granularity needed.
Currently, only Binance Spot provides one-second candles. You may need a server in a region where Binance is accessible, or use Tailscale to route requests through an allowed region.

Running Backtests

Via Hummingbot Scripts

Hummingbot includes backtesting scripts in the scripts/ folder:
The script outputs:
  • Processing time (e.g., “34 seconds for 0.5 days”)
  • Interactive Plotly chart in browser

Via Condor Web Dashboard

  1. Navigate to BotsBacktest
  2. Select a controller config
  3. Set the time range
  4. Run and view results

Interpreting Results

Chart Panes

The Plotly output has three panes:

P&L Lines

Executor Colors

Example Analysis

Portfolio Allocation: 2% vs 10%

2% allocation:
  • Inventory builds gradually
  • Trading continues through drawdowns
  • More consistent activity
10% allocation:
  • Inventory builds quickly
  • May hit max position during drawdowns
  • Trading stops if position is underwater and at max (profit protection enabled)

PMM Mister Parameters

Key parameters that affect backtesting behavior:

Trading Bots vs Trading Agents

Agents can oversee and modify bot parameters, but they operate at a higher level (every minute+) rather than every tick. This separation keeps HFT performance while adding intelligent oversight.