When a program trades, the test shows what it should have done. The broker's records show what it did. By the end of this lesson, you'll know how to put the two side by side, one trade and one fill at a time. And you'll sort every difference into one of four kinds.
1 of 9
What you'll learn
- Test the same days. Use the same settings, then list live and test trades one by one.
- Measure your slippage. A worse fill than the test is slippage you can count in ticks.
- Sort every difference. Label it price, timing, missing or extra.
- Trace missing and extra trades. They usually point to the program itself.
- Act on the cause. Fix code for missing or extra trades. Raise test costs for slippage.
Exercise
- On a practice account, take one week of an automated or alert-driven strategy.
- Run the Running a strategy’s exact rules over past prices to see which trades they would have taken.More in the glossary over the same days, list both trade by trade, and label every difference: price, timing, missing or extra.
Quick check
1. The live program took a trade the test didn't. Which kind of difference is that?
2. A test entry is 5,012.25 and the live fill is 5,013.00. How many ticks is that on the Micro S&P 500?
3. Slippage is much bigger live than the test allowed. What does that suggest?
0 of 3 answered.
Finished this lesson?
Tick it off and keep your place
Read the full notes
To check live trades against the test, run the test over the same days with the same settings, list both trade by trade, and sort every difference into price, timing, missing or extra; missing and extra trades usually point to the program, not the market.
- Run the Running a strategy’s exact rules over past prices to see which trades they would have taken.More in the glossary over exactly the days the program traded, same settings and contract. List both trade by trade (signal time, intended entry, When an order trades. An order can fill all at once, in parts, or not at all.More in the glossary, stop, target, exit) and explain every difference. See Is the forward test close enough.
- Made-up fill: test entry 5,012.25 at the signal close; live fill 5,013.00. 0.75 points = 3 The smallest step a price can move. On many stock index futures that’s 0.25 of a point.More in the glossary = $3.75 a contract on the A small futures contract on the S&P 500, traded at CME Group. Each point is worth $5, and its smallest step of 0.25 is worth $1.25.More in the glossary. That's The difference between the price you expected and the price your order filled at.More in the glossary: see Measuring slippage in your own trades.
- Four kinds of difference: price (same trade, different fill); timing (same trade, later); missing (the test traded, the program didn't: check the A time-stamped record a program writes as it runs: what it saw, what it decided, what it sent and any errors.More in the glossary for restarts, disconnects or caps); extra (the program traded, the test didn't: it can mean code and test following different rules).
- Made-up week, in A result measured in units of the amount at risk. If a trade risks 4 points, 1R is 4 points and a 6-point gain is +1.5R.More in the glossary: test +2, −1, +2, none = +3.0R; live +1.9, −1.1, missed, −1.0 = −0.2R. Gap 3.2R: price 0.2R, missing 2.0R, extra 1.0R (a trade on a Prices that have stopped updating, often because a data connection has frozen, so the last price shown is out of date.More in the glossary price).
- Fixes: code and routine for missing and extra trades; bigger cost settings in the test if slippage is larger than allowed (Costs and slippage settings). More: Why forward results can differ and Backtest vs live results. Answer to the drill: 3 ticks.
Worked example
Made-up numbersAdding up a week’s gap
Made-up results in R
- Test: +2 − 1 + 2 = +3.0R.
- Live: +1.9 − 1.1 − 1.0 = −0.2R.
- Gap 3.2R: price 0.2R, missing trade 2.0R, extra trade 1.0R.
Most of the gap came from the program (a missed and an extra trade), not from the market.
Your turn
DrillMade-up numbers · Micro S&P 500 · 1 tick = 0.25 points · a long trade · test entry 5,021.50 · live fill 5,022.25
Trading is risky. You can lose money. Test results are hypothetical, and a test can’t tell you what will happen next. This lesson explains how to compare. It isn’t advice.