Backtester
Strategy backtester
Bar-by-bar JS strategy engine in the same Web Worker sandbox as indicators.
The Backtester window loads OHLCV from any Binance symbol + interval, then runs your strategy function against each bar in sequence. Returns: trades + equity curve + P&L + max drawdown + win rate + buy-and-hold baseline.
Strategy signature
Default example — SMA crossover
Engine semantics
- Starting equity: 1000 units of quote currency.
- BUY converts equity to position at the bar's close. SELL closes the position at the close.
- No slippage, no fees modelled. Take the P&L as 'best case' and add your venue's fee schedule mentally.
- BUY when already long is a no-op; SELL when flat is a no-op.
infoSame Web Worker sandbox as indicators — same 1-second per-call timeout, same DOM-free environment. If your indicator code uses ctx.sma / ctx.ema you can drop it in here directly.