Skip to content
Wildflower
Join free
Not fooling yourself

Free Trading School · Level 4 · Course 4.3

Look-ahead bias

Lesson 2 of 18 in Not fooling yourselfModule 1: Biases that flatter a test

Testing and making it your own · Not fooling yourself

Look-ahead bias

Wildflower Trading School · Lesson 4.3.1.2

Wildflower

The first family of ways a test can flatter a strategy is looking ahead. By the end of this lesson, you'll be able to spot look-ahead bias. That's when a test uses a price that wasn't known yet at the moment of the decision. You'll watch one made-up trade flip from a win to a loss once it's fixed. Then you'll see the common places it hides, and a simple check you can run on any rule.

1 of 7

What you'll learn

  • Spot look-ahead bias. It uses a price not known yet and flatters every signal.
  • Enter at the next open. A fair entry can turn a test win into a loss.
  • Wait for candles to close. A high, low or range can still change until it ends.
  • Log signal and entry times. The entry time can never come before the signal time.
  • Assume the worst. If one candle hits both stop and target, count the stop.

Exercise

  1. Take one of your past test logs, or replay ten signals of any rule from The strategy library.
  2. Add two columns, signal time and entry time, and fill them in.
  3. Then check that no entry time is earlier than its signal time.

Next: Cherry-picking.

Quick check

  1. 1. A rule needs a candle to close above a level. When is the earliest honest entry?

  2. 2. One candle reaches both the stop and the target. What does a cautious test count?

  3. 3. Why does look-ahead bias matter so much over many trades?

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 “Cherry-picking” is waiting next time.

Read the full notes

Look-ahead bias is when a uses a price that wasn't known yet at the moment of the decision, such as entering at a candle's open because of how it closed. It makes every signal look better than it could have been.

  • is when a test uses a price that wasn't known yet at the moment of the decision. It always flatters the strategy, on every signal.
  • Made-up example: buy when a 5-minute closes above the high before it, 4 points, 6. Entering at the signal candle's open (5,003.00) wins +$30; the honest entry, the next open (5,006.50), loses −$20.
  • Other places it hides: acting on a candle's high, low or close before it finishes; trading a range such as the before it's finished; a higher- line set up to show the finished day too early (TradingView's guide calls this leaking future data into the past); a candle that touches both stop and target.
  • The check: for each decision, ask which candles had closed. Log a signal time and an entry time on every row; the entry can never come first. When one candle hits both, count the stop.
  • hides the candles to the right, which helps. More: Look-ahead bias.

Worked example

Made-up numbers

One chart, two results

Made-up numbers · 1 · 1 point = $5 · stop 4 points, target 6 · before costs

  1. Signal: the 10:05 candle closes at 5,006.50, above the 5,004.00 high before it, at 10:10
  2. Look-ahead entry at its open, 5,003.00: target 5,009.00 hit. +6 points = +$30 ()
  3. Honest entry at the next open, 5,006.50: stop 5,002.50 hit. −4 points = −$20 (−1R)
  4. The entries are 3.5 points, 14 , apart

The same signal flips from a win to a loss once the test only uses what was known at the time.

Your turn

Drill

Made-up numbers · signal candle opened at 5,010.00 · next candle opens at 5,012.25 · a test entered at 5,010.00

Trading is risky. You can lose money. Test results are hypothetical, and a good test doesn't mean future profits. This lesson explains how testing works. It isn't advice.