Skip to main content
All manual pages

Backtest

Test a trading rule on years of daily prices before you risk money. Choose a strategy or write your own entry and exit rules, add commission and slippage, allow shorts, and save what works.

Backtest replays a rule on past daily bars for one stock and tells you what it would have done: total return, drawdown, win rate and every trade. It is a way to check an idea, not a promise. Backtest needs a Pro plan.

The backtest formThe backtest form
The backtest form

How to run a backtest

  1. Click Backtest in the sidebar.
  2. Enter a ticker in Symbol. It starts on AAPL.
  3. Pick a Strategy: RSI Crossover, MA Crossover, MACD Signal, Bollinger Breakout or Custom Formula (Pine-lite).
  4. Set Start Date and End Date. They start at one year ago and today.
  5. Set Initial Capital ($). It starts at 10,000.
  6. Change the strategy's own inputs, such as the RSI period or the oversold and overbought levels.
  7. Click Run Backtest.

How to make the test more realistic

Under the strategy inputs, four settings apply to every strategy:

  • Commission (bps): a cost on every buy and sell, in basis points. 10 bps is 0.10%.
  • Slippage (bps): how much worse than the bar's price each fill is. Buys fill higher and sells fill lower.
  • Position Size (%): the share of your cash used on each entry, from 1 to 100. It starts at 100.
  • Shorts: tick ALLOW_SHORT to let the rule also sell short. With it on, an exit signal while you hold nothing opens a short, and an entry signal closes it.

Both cost fields start at 0. Try 5 to 10 bps for each to see how much of a rule's profit survives trading costs.

How to write your own rule

  1. Choose Custom Formula (Pine-lite) as the strategy. Two boxes appear, one for the entry rule and one for the exit rule.
  2. Click a preset to fill them: RSI reversion, SMA trend or 55-bar breakout.
  3. Or type your own, for example rsi(close, 14) < 30 to enter and rsi(close, 14) > 70 to exit. Each rule must be true or false on each bar.
  4. A message under a box tells you if the rule cannot be read. Fix it before you run.

How to read the results

  • The stat tiles show Total Return, Buy & Hold, Max Drawdown, Sharpe Ratio, Win Rate, Total Trades, Final Equity and vs Buy & Hold. Beating buy and hold is the bar to clear.
  • The Equity Curve plots your account against simply holding the stock.
  • The Trade Log lists each trade as a buy, sell, short or cover, with date, price, shares and profit.

How to save a strategy

  1. Type a name in Strategy name in the saved strategies box.
  2. Click save. The whole setup is stored, including the dates, costs and formulas.
  3. To use it again, pick it from the saved list and click load. It fills the form. Delete removes it.

You can keep up to 100 saved strategies.

Good to know

  • Backtests use daily bars, so they cannot test intraday rules.
  • Past results do not predict future ones. Long tests on one stock overfit easily, so try several tickers and periods.

If something doesn't work

  • An upgrade card shows: Backtest needs Pro. See Pricing.
  • Zero trades: the rule never triggered in that window. Widen the dates or loosen the rule.
  • The formula will not run: read the message under the box. Check brackets and that each rule ends in a true or false test.
  • No data for a ticker: check the spelling and that it traded in the dates you chose.