Skip to main content

Documentation Index

Fetch the complete documentation index at: https://condor.hummingbot.org/llms.txt

Use this file to discover all available pages before exploring further.

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

Use CaseExample
Parameter sensitivity”What happens if I change portfolio allocation from 2% to 10%?”
Behavior validation”Is my strategy placing sell orders only after reaching 30% inventory?”
Relative comparison”Does configuration A generate more volume than B?”
Strategy debugging”Why did the bot stop trading in this scenario?”

Supported Executors

The backtesting engine works with controllers using these executors:
ExecutorSupportedNotes
Position ExecutorYesFull support including position hold
DCA ExecutorYesDollar-cost averaging strategies
Grid ExecutorYesGrid trading strategies
Order ExecutorComingNot yet supported
Arbitrage ExecutorNoRequires order book data
XEMM ExecutorNoRequires cross-exchange order books

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 2.14+ includes backtesting scripts in the scripts/ folder:
cd ~/hummingbot
python scripts/backtest_pmm_mister.py 0.5  # Backtest 0.5 days
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:
PaneContent
TopCandles with executor markers
MiddleP&L lines and volume
BottomPosition size over time

P&L Lines

LineMeaning
YellowTotal P&L (realized + unrealized)
PurplePosition unrealized P&L
Gap between yellow and purpleExecutor realized P&L

Executor Colors

ColorMeaning
WhiteOrders placed but not filled (early stop/refresh)
GreenFilled orders that hit take profit
BlueFilled orders moved to position hold (market went against you)
PurpleExecutors reducing position (selling accumulated inventory)

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)
# With profit_protection=true and 10% allocation:
# If market drops while at max position → bot stops trading
# Bot resumes only when position becomes profitable again

PMM Mister Parameters

Key parameters that affect backtesting behavior:
ParameterDescriptionExample
portfolio_allocation% of capital placed around mid price0.02 (2%)
min_base_percentageMinimum inventory before selling0.30 (30%)
max_base_percentageMaximum inventory before buying stops0.70 (70%)
max_active_executors_by_levelHow many times to replace a level20
cooldown_timeSeconds between level replacements30
price_distance_toleranceMinimum price move before replacement0.0002
activization_timeSeconds before inventory is “permanent”1660
profit_protectionOnly sell if position is profitabletrue

Trading Bots vs Trading Agents

AspectTrading BotsTrading Agents
LogicDeterministic, codedLLM-driven decisions
Tick speed1 second or faster60+ seconds
BacktestingFully supportedNot applicable
Use caseHFT market makingOversight, strategy selection
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.