Backtesting
The backtest system uses OKX's real historical candles to simulate strategy execution, telling you "if you'd run this strategy over that period, you'd have made X".
⚠️ Backtest performance ≠ future performance. Backtesting only rules out "obviously bad" strategies; it does not guarantee live profitability.

Parameters
| Field | Meaning |
|---|---|
| Strategy | The strategy to test (custom / preset) |
| Symbol | Underlying, e.g. BTC/USDT |
| Timeframe | Candle period, e.g. 1h / 1d |
| Initial Capital | Starting capital (USDT) |
| Fast / Slow Period | SMA strategy parameters (used by presets) |
What to look at after a run
Core metrics
| Metric | How to read |
|---|---|
| Total Return | Total return (%) |
| Max Drawdown | Largest drawdown during the period (%), lower is better |
| Win Rate | Percentage of profitable trades |
| Sharpe Ratio | Risk-adjusted return; > 1 is usually OK |
| Profit Factor | Total profit / total loss; > 1.5 is usually good |
| Trade Count | Total trades (too few means the strategy didn't trigger) |
Equity curve
The equity curve shows how capital evolves over time. Ideally:
- Smooth upward
- Small drawdowns, short durations
- No long flat periods
Trade list
Each row is one trade:
- Entry / Exit time + price
- PnL (USDT + %)
- Holding duration
BacktestReplay: per-candle playback
The backtest result also includes per-candle frame data (BacktestResult.frames). The BacktestReplay component uses this for frame-level playback:
- 1× / 2× / 4× speed
- Draggable time slider
- Entry (▲) and exit (✓) markers overlaid on the candle chart
- Real-time display of current position, unrealized PnL, equity curve position
Useful for answering "what was the strategy thinking in that period".
FAQ
Q: Backtest and live don't match?
A: Paper has small differences (slippage, matching); live has real slippage, market impact, funding rates (futures). Suggestions:
- Run on Paper for 1+ week and compare to backtest
- Watch if max drawdown is deeper than backtest
- Tighten SL if needed
Q: Backtest shows 0 trades?
A: Usually rules didn't trigger. Check:
- Are indicator thresholds too extreme (e.g. RSI < 10)?
- Is the timeframe too short to see the trigger?
- Is the symbol's liquidity too weak?
Q: Sharpe is negative?
A: The strategy was losing during the historical drawdown period. Two options:
- Adjust parameters so rules don't exit during drawdowns (add filters)
- Pick a different strategy
System constraints
- FREE tier: 10 backtests per day
- PRO/WHALE: unlimited
- Each backtest's lookback is limited by candle availability (OKX generally provides 1-2 years of 1m candles)