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 KDJ Cross strategy on real crypto candles

The KDJ Cross strategy trades the K/D crossover of the stochastic oscillator: it goes long when the fast K line crosses above the slow D line (9/3/3 settings) and exits on the cross back down. Because the stochastic measures position within the recent range, these crosses fire near local turning points rather than after extended trends — a short-term, reactive style.

This page loads the rule with K and D drawn beneath the price chart. The simulator fills at the next bar's open with your fees and slippage applied, then reports the equity curve, Sharpe/Sortino ratios, max drawdown, profit factor and the full trade list — computed locally 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

What are the KDJ cross backtest rules?

RSV places each close in its 9-bar high–low range; K = SMA(RSV,3,1) and D = SMA(K,3,1). ENTRY fires when K crosses above D, EXIT when D crosses above K — both filled at the next bar's open.

Is KDJ good for crypto swing trading?

KDJ crosses react quickly, which suits crypto's sharp rotations — at the cost of many small whipsaw losses in trends. Whether the ratio pays off depends heavily on the pair and interval, which is precisely what this backtester measures; try adding a stop-loss or pairing it with a trend filter.

More strategy backtester pages

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

Related tools

KDJ in the Indicator Lab