Running Backtests
The Backtest tab lets you run a single strategy against historical data and view detailed performance results.
Setting Up a Backtest
-
Navigate to the Backtest tab in the sidebar
-
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.,
BTCUSDTon Bybit orBTC-USDTon Blofin) - Bar size — Candle timeframe (1m, 5m, 15m, 30m, 1h, 4h, 1d)
- Date range — Start and end dates for the backtest period
-
Write or paste your Rune Script strategy in the code editor
-
Adjust any strategy parameters using the parameter controls
-
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:
| Metric | Description |
|---|---|
| Net P&L | Total profit or loss |
| ROI | Return on investment as a percentage |
| Win Rate | Percentage of profitable trades |
| Profit Factor | Gross profit divided by gross loss |
| Max Drawdown | Largest peak-to-trough decline |
| Total Trades | Number of trades executed |
| Avg Win / Avg Loss | Average 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)