Included with TickSurfers Pro

Backtest trading strategies in your browser

Run a built-in strategy or write your own in JavaScript. See where it entered and exited, how equity changed, and how much it fell from its peak.

A free account opens the chart. Backtesting, optimization, and walk-forward analysis require Pro.

Read a backtest report

Illustrative trade log with synthetic prices, one share per trade, and no fees or slippage. Starting equity is $1,000.

Illustrative closed-trade equity and profit or loss
TradeEntryExitP/LEquity
1$100$106+$6$1,006
2$108$104−$4$1,002
3$105$112+$7$1,009

Closed-trade equity fell $4 from its prior peak after trade 2, even though the sample ended $9 above its starting equity.

Try the built-in Bar On Close strategy

  1. Open the chart with Pro and load SPY on a daily timeframe. Load enough history for the 200-bar moving average.
  2. Select Sample Strategy: Bar On Close and keep its default inputs for the first run.
  3. In Backtest, select Run Backtest. Review the trade log, equity curve, and entry and exit markers. Note your history window before comparing runs.

What the JavaScript strategy tests

The sample uses a 4-bar RSI and a 200-bar simple moving average. Its long-entry branch buys when price is above the moving average and RSI falls below 15. It exits the long when RSI reaches 70 or price closes below the moving average. The sample also includes short rules and models market orders at the current bar’s close.

if (close > sma && rsi < inputs.rsiLong) {
    strategy.buy();
}

Long-entry excerpt from the built-in strategy’s flat-position branch. Historical simulations do not predict future results.

Compare parameter settings

Use Optimization to test a range of input values, such as several RSI thresholds. Sort the results by a built-in metric or score runs with a JavaScript fitness function.

Test on unseen bars

Walk-Forward Analysis selects settings on an in-sample window and tests them on the next out-of-sample window. Compare those results with the original backtest before relying on a parameter set.

Explore TickSurfers strategy research →