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 Trend Dip strategy on real crypto candles

Trend Dip is a pullback strategy for uptrends. The entry needs two things on the same bar: the close crossing back above the lower Bollinger band (20 bars, 2σ) — a stretched dip being reclaimed — and price still above its 100-bar moving average, the trend filter that separates a dip in an uptrend from a knife in a downtrend. The exit is deliberately boring: sell when the close returns to the 20-bar mid band.

The logic is mean reversion inside a trend: it never buys breakouts, only give-backs, and it lets the position ride through scary wicks because the thesis is the snap back to the mean, not the stop. In a walk-forward study across 40 major coins on 4-hour bars (70% in-sample / 30% held-out, fees and slippage included), the rule won 73.6% of its 174 out-of-sample trades with a median per-coin max drawdown around 6% — verify it yourself on any pair here before trusting it.

This page loads the full rule into the backtester with the trend line and both bands drawn on the price chart. Orders fill at the next bar's open, fees and slippage are configurable, and every trade, the equity curve, Sharpe, Sortino and drawdown are computed locally in your browser on real exchange candles.

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

Why does Trend Dip buy the reclaim instead of the band touch?

A close below the lower band can keep falling — buying the touch catches knives. The entry fires on CROSS(C, LOWER), the bar whose close comes back above the band: the market has already rejected the low once, which is a materially better entry than the first touch.

Why is there no stop-loss in the formula?

The exit is the mid band: the trade thesis is the snap back to the 20-bar mean, so the strategy holds through wicks below the band. Walk-forward tests with a 10–20% protective stop added produced almost identical results (stops almost never triggered); the backtester's optional stop-loss field lets you cap tail risk yourself if you prefer.

Which timeframe suits Trend Dip best?

In testing, 4-hour bars were the sweet spot: daily bars produce too few entries (roughly one per coin per quarter out-of-sample) and 1-hour bars leak the edge to fees. On 4h the average winning cycle completes in about two days.

More strategy backtester pages

MA Cross 5/20 · MACD Cross · RSI 30/70 · Bollinger Breakout · KDJ Cross · Donchian 20/10 · Capitulation Reversal · Net Flow Trend · Trend Ignition

Related tools

Bollinger Bands in the Indicator Lab · Bollinger Breakout in the Strategy Backtester · Capitulation Reversal in the Strategy Backtester · RSI 30/70 in the Strategy Backtester