Strategy Backtester

Backtest signal strategies over real exchange candles — the same WASM indicator engine computes your ENTRY/EXIT lines, and the simulator fills at the next bar's open with fees, slippage and optional protective stops.

Loading WASM engine…
Symbol
Interval
Loading WASM indicator engine…
Run a strategy to see the equity curve
Strategy presets (click to load)
Strategy formulaCtrl+Enter to run
Simulation parameters
How fills are simulated

ENTRY / EXIT are 0/1 output lines of the same array DSL the Indicator Lab uses — the WASM engine computes them over the loaded candles; any other output lines are drawn on the chart.

Beyond H L O C V, formulas can reference data series by name — DATE TIME MKTCAP TVOL — auto-loaded and aligned to the bars (CoinGecko series are daily, forward-filled on intraday charts).

A signal known at bar close fills at the next bar's open (no lookahead bias), worsened by slippage; fees apply per side.

Stop-loss / take-profit trigger intrabar against the bar's low/high — gaps fill at the open, and when both are touchable in one bar the stop is assumed first.

Long-only, all-in per trade; an open position at the end of the data is closed at the last close. Sharpe/Sortino are annualized from per-bar equity returns.

Backtest the Donchian 20/10 strategy on real crypto candles

The Donchian 20/10 strategy is the classic Turtle breakout: buy when the close exceeds the prior 20-bar high — a breakout to a multi-week extreme — and exit when it falls below the prior 10-bar low, a faster channel that tightens the stop as the trade matures. It is pure trend capture: no oscillators, no smoothing, just range extremes.

This page loads the rule with both channels drawn on the price chart. The backtester fills at the next bar's open, applies your fees and slippage plus optional stop-loss/take-profit, and reports the equity curve, Sharpe/Sortino, max drawdown, profit factor and every trade — all computed locally in your browser.

How it works

  1. Pick a trading pair, interval and number of bars.
  2. The strategy ENTRY/EXIT formulas load into the editor, fully editable.
  3. Set fees, slippage and optional stop-loss / take-profit.
  4. Run the simulation and inspect the equity curve, Sharpe/Sortino, drawdown and trade list.

Frequently asked questions

What are the Donchian 20/10 backtest rules?

ENTRY fires when the close is above yesterday's 20-bar highest high (C > REF(HHV(H,20),1)); EXIT fires when it is below the prior 10-bar lowest low. The asymmetric 20/10 windows are the original Turtle design: slow to enter, quicker to exit.

Why does the Turtle breakout suit crypto?

Crypto produces some of the longest, strongest trends of any asset class, which is what breakout systems harvest — at the price of many small failed-breakout losses in between. The trade list and drawdown metrics here show whether that profile fits your risk tolerance.

More strategy backtester pages

MA Cross 5/20 · MACD Cross · RSI 30/70 · Bollinger Breakout · KDJ Cross

Related tools

Bollinger Breakout in the Strategy Backtester · Bollinger Bands in the Indicator Lab