Skip to content

Running Backtests

The Backtest tab lets you run a single strategy against historical data and view detailed performance results.

Setting Up a Backtest

  1. Navigate to the Backtest tab in the sidebar

  2. Configure your backtest:

    • Exchange — Select the exchange (Blofin, Bybit, Bitget, Bitunix, or Hyperliquid)
    • Symbol — Select the trading pair in the exchange's native format (e.g., BTCUSDT on Bybit or BTC-USDT on Blofin)
    • Bar size — Candle timeframe (1m, 5m, 15m, 30m, 1h, 4h, 1d)
    • Date range — Start and end dates for the backtest period
  3. Write or paste your Rune Script strategy in the code editor

  4. Adjust any strategy parameters using the parameter controls

  5. Click Run Backtest

You need to download data before running a backtest. Go to the Data tab to download historical candles for your chosen exchange and symbol.

Understanding Results

After a backtest completes, you'll see several analysis sections:

Equity Curve

Portfolio value over time. Shows how your capital grew or shrank throughout the backtest period.

Drawdown Chart

Percentage decline from the equity peak at each point in time. Deeper drawdowns mean higher risk exposure.

Trade Distribution

Histogram of individual trade returns. Green bars are profitable trades, red bars are losses.

Win Rate

Proportion of winning trades vs losing trades.

Long vs Short Analysis

Compares performance between long and short trades across net P&L, win rate, and trade count.

Cumulative P&L

Running total of profit and loss across each trade in sequence.

Monthly Returns

Portfolio return for each calendar month. Green indicates a profitable month, red a losing month.

Performance Metrics

Detailed metrics split by All, Long, and Short trades including:

MetricDescription
Net P&LTotal profit or loss
ROIReturn on investment as a percentage
Win RatePercentage of profitable trades
Profit FactorGross profit divided by gross loss
Max DrawdownLargest peak-to-trough decline
Total TradesNumber of trades executed
Avg Win / Avg LossAverage size of winning vs losing trades

Execution Model

Trades are filled with the Next Open execution model: a signal on one candle executes at the open of the next candle — the most realistic way to simulate acting on a closed-candle signal.

Tips

  • Start with longer bar sizes (1h, 4h) for faster backtests when developing strategies
  • Use shorter bars (1m, 5m) for final validation once your strategy logic is solid
  • Download sufficient data — at least 30 days for meaningful results
  • Compare results across different market conditions (trending vs ranging)