/Documentation

Execution

Paper Trading

Last updated April 20, 2026

Paper mode runs your strategy against real live market data with simulated order fills. No exchange account is required, no money moves, and all the same execution logic runs — including condition tracking, structured logs, and position management. It is the default mode for all new projects.

Overview

When a project is set to Paper mode, the runner uses a PaperBroker in place of the LiveBroker. The broker abstraction is identical — strategy code callsHP.buy() and HP.sell() exactly the same way in both modes. The difference is entirely in how those calls are resolved into fills.

Paper modeLive mode
Fill priceCurrent mark price (latest close of primary timeframe)Actual Binance MARKET order fill
FeesZeroBinance exchange fees (0.1% or lower)
SlippageZeroReal market slippage applies
Wallet requiredNoYes — encrypted API key
Position stored in DBYesYes
Logs writtenYes — full TRADE_TRIGGER + TRADE_EXECUTEDYes — full TRADE_TRIGGER + TRADE_EXECUTED
Analytics availableYesYes

Everything above the broker layer — condition tracking, position state, log structure, analytics — behaves identically in both modes. Paper mode is not a "demo" — it uses the same execution pipeline as live mode.

How Fills Work

In paper mode, when HP.buy(usd) is called:

  1. The PaperBroker reads the current mark price — the most recent close of the primary timeframe kline series.
  2. It computes the quantity as usd ÷ mark_price.
  3. It creates a position row with entry_price = mark_price, qty = computed_qty, fee = 0.
  4. It logs a TRADE_EXECUTED entry with fill_price = mark_price, slippage = 0.

When HP.sell(pct) is called:

  1. The PaperBroker reads the current mark price.
  2. It computes the USD proceeds as qty × (pct/100) × mark_price.
  3. It updates or closes the position row with close_price = mark_price.
  4. PnL is recorded as (close_price − entry_price) × qty_sold.
ℹ️
Mark price priority order: The runner uses the most recent close available, checking timeframes in order: 1m → 5m → 15m → 1h → 4h. The first series that has a fresh (non-stale) close is used as the mark price.

What Is Real in Paper Mode

Despite being simulated at the fill level, many things in paper mode are completely real:

📡
Real market data

Your strategy evaluates against live Binance kline data on every tick. Conditions trigger on real price movements.

⚙️
Real execution engine

The same compiled JS, sandbox, indicator library, and condition tracking system that runs in live mode.

📋
Real logs

Full TRADE_TRIGGER condition tables and TRADE_EXECUTED fill records are written for every paper trade.

📊
Real analytics

The same position tracking, PnL calculation, and analytics available on live mode positions.

This makes paper mode genuinely useful for validating that strategy logic is working correctly in a real market environment before committing capital.

Switching to Live

To switch a project from Paper to Live mode:

  1. Go to Settings inside the project.
  2. Under Mode, select Live.
  3. Under Wallet, select the wallet containing your Binance API credentials. If you haven't added one yet, go to Settings → Wallets first.
  4. Save settings. The change takes effect on the next scheduled tick.
🚨
Live mode places real MARKET orders. Before switching, verify your strategy logic is correct in paper mode, use small position sizes in your first live run, and ensure your API key has only Spot Trading permissions enabled — not withdrawals.

Switching from Live back to Paper mid-run is safe — the change takes effect on the next tick. Any open positions in live mode will remain open (they are not automatically closed when you switch modes), and subsequent exits will use paper fills.

Paper Trading Limitations

Paper mode will produce better numbers than live mode on the same strategy. This is an inherent property of simulated execution, not a bug. The main gaps:

FactorPaper modeLive reality
Fill priceFills at the exact mark price at the moment of signalMARKET fills at best available ask/bid, which can differ — especially on low-liquidity pairs or at high volatility moments
FeesZeroBinance charges 0.1% per trade by default (lower with BNB fee discount). On a $1,000 round trip: ~$2 in fees
LiquidityAny order size fills instantly at mark priceLarge orders may move the market or partially fill
LatencyFill is instantaneous (computed locally)Network latency between the runner and Binance affects the exact fill time

For most retail-scale strategies on liquid pairs (BTCUSDT, ETHUSDT), the difference between paper and live performance is small on a per-trade basis. For high-frequency strategies or large position sizes, it can be material.