Skip to content
Wildflower
Join free
Automated trading and AI

Free Trading School · Level 7 · Course 7.11

Checking live trades against the test

Lesson 9 of 19 in Automated trading and AIModule 2: What can go wrong

Advanced · Automated trading and AI

Checking live trades against the test

Wildflower Trading School · Lesson 7.11.2.5

Wildflower

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

  1. On a practice account, take one week of an automated or alert-driven strategy.
  2. Run the over the same days, list both trade by trade, and label every difference: price, timing, missing or extra.

Next: What AI can and can't do in trading.

Quick check

  1. 1. The live program took a trade the test didn't. Which kind of difference is that?

  2. 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. 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

Make a free account and we'll remember where you are, so “What AI can and can't do in trading” is waiting next time.

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 over exactly the days the program traded, same settings and contract. List both trade by trade (signal time, intended entry, , 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 = $3.75 a contract on the . That's : 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 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 : 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 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 numbers

Adding up a week’s gap

Made-up results in R

  1. Test: +2 − 1 + 2 = +3.0R.
  2. Live: +1.9 − 1.1 − 1.0 = −0.2R.
  3. 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

Drill

Made-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.