Documentation

2. Running Your First Backtest

Created
Jun 5, 2026
Updated
Jun 5, 2026

This page walks through a backtest end to end using a built-in template, so you can see results without writing any code first.

1. Open the Strategy Tester

Open the Backtesting panel (toolbar, or /chart/BTCUSDT?panel=backtesting). It opens on the Compose tab.

2. Pick a template

The Compose tab includes ready-to-run starter strategies. Pick one to load its code into the editor:

TemplateWhat it does
Minimal starterAn empty scaffold with the init/next lifecycle hooks.
SMA crossGoes long on a fast/slow SMA golden cross, exits on the death cross. (The default.)
RSI mean reversionBuys oversold (RSI < 30), sells back above 55.
Bull flag breakoutEnters on a detected bull-flag breakout with a time-based exit.
Pyramiding pullbackScales into uptrend pullbacks across three entry layers with per-layer exits.

3. Run it

Press Run. The strategy compiles and executes over the bars loaded for the active pane's symbol and timeframe. When it finishes, the panel switches to the Performance tab automatically.

If the strategy has a syntax or runtime error, the tester reports the message (and line where possible) instead of results — fix it in the editor and run again.

4. Read the results

  • Performance — headline metrics (net profit, return %, win rate, profit factor, drawdown) plus detailed breakdowns and the equity curve against buy-and-hold.
  • Trades — every trade the strategy took, with entry/exit, P&L, and duration. The tab label shows the trade count.
  • Code — the exact source that produced the result.

Full detail on every metric is in Reading Backtest Results.

5. Iterate

Edit the code or switch the chart to a different symbol or timeframe, then Run again. Reset restores the template's default code, and Clear clears the editor. To keep a version, save it as a draft — see Saving & Managing Drafts.

Next steps

Learn what each result metric means.

Next: Reading Backtest Results