# Demo first: forward testing

> Run the strategy on live data without real money and decide in advance what result counts as a pass.

Source: https://quantraider.com/learn/analysis-and-live/demo-first

Course: Analysis and going live safely (lesson 3 of 6) · Level: Advanced · 3 min

A backtest uses past data; a demo account tests the strategy on live prices without risking money. This lesson explains how to run a demo period so that it produces a clear answer, by deciding in advance what counts as a pass.

## Why forward test

**Forward testing** runs the finished rules on live data, one candle at a time, so look-ahead bias is impossible and every fill happens at a real quote. It also tests the machinery: connection, order handling, timing and your own ability to follow the plan. A demo account does this at no financial cost.

Demo fills are not identical to live fills. Demo accounts often show better execution than real ones, so a demo period reduces uncertainty but does not remove it. That is one reason to move to live trading only at small size afterwards.

## Decide the pass rule first

Write the pass or fail rule before the demo starts, otherwise you will bend it to fit whatever happens. A reasonable rule combines a minimum number of trades with a result that falls inside the range the backtest predicts, plus a check that execution matches the assumptions.

**Worked example: A pass rule with numbers**

1. The backtest showed +0.25R expectancy with σ_R = 1.4R, and the strategy takes about 5 trades per week.
2. Rule: at least 100 trades, which at 5 per week takes 100 / 5 = 20 weeks.
3. With 100 trades the standard error is 1.4 / √100 = 0.14R, so the approximate 95% range is 0.25 ± 0.274, which is about −0.02R to +0.52R.
4. Pass if the demo expectancy lies in that range and the average cost per trade is within 0.05R of the backtest assumption.
5. The demo result is +14R over 100 trades, so +0.14R per trade, inside the range. Average cost was 0.09R against 0.05R assumed, so the gap is 0.04R per trade, 4R over 100 trades.

The expectancy and the cost gap are both within the rule, so this demo passes, with a note that real costs were a little higher than assumed.

> **A wide range is the point**
>
> The range from −0.02R to +0.52R is wide, because 100 trades cannot pin the expectancy down. A demo can mostly rule out a broken strategy; it cannot confirm a precise edge.

## Compare fills and costs

Keep a record of the backtest entry price and the demo fill for each trade. The difference is slippage, and the spread you actually paid should be compared with the spread assumed in the backtest. If live fills are consistently worse by a fixed amount in R, subtract that from the backtest expectancy and see whether an edge remains.

- Number of trades against the minimum in your rule.
- Demo expectancy against the range expected from the backtest.
- Average spread and slippage against the backtest assumptions.
- Trades that the backtest would have taken but the demo missed, or the reverse, and why.

> **Connect a broker account**: Use a demo account when you connect a broker, and keep the strategy on it until your pass rule is met. [Open connected brokers](https://quantraider.com/connected-brokers)

## Key takeaways

- Forward testing on a demo account removes look-ahead bias and tests the execution chain without financial risk.
- Decide the pass or fail rule in advance, for example a minimum trade count and an expectancy inside the backtest range.
- A demo period can mostly rule out a broken strategy; it cannot confirm an exact edge.
- Compare live and backtest fills, spreads and slippage, and express the gap in R.

> Educational content, not financial advice. Trading involves risk of loss.
