Look-Ahead Bias

From CEOpedia | Management online
Revision as of 17:26, 1 December 2019 by Sw (talk | contribs) (Infobox update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Look-Ahead Bias
See also

Look-Ahead Bias means that your backtest program is using tomorrow's prices to determine today's trading signals. Or more, generally, it is using future information to make a prediction at the current time. A common example of look- ahead bias is to use a day's high or low price to determine the entry signal during backtesting. (Before the close of a trading day, we can't know what the high and low price of the day are.)

Look-ahead bias is essentially a programming error and can infect only a backtest program but not a live trading program because there is no way a live trading program can obtain future information. This difference between backtesting and a live trading program also points to an obvious way to avoid look-ahead bias. If your backtesting and live trading programs are one and the same, and the only difference between backtesting versus live trading is what kind of data you are feeding into the program, then there can be no look-ahead bias in the program[1].

Types of biases

There are three types of biases[2]:

  • survivorship bias a test design is subject to survivorship bias if it fails to account for companies that have gone bankrupt, merged, or otherwise departed the database.
  • look-ahead bias a test design is subject to look-ahead bias if it uses information unavailable on the test date. In this example, the analysis conducted the test under the assumption that the necessary accounting information was available at the end of the fiscal year.
  • time-period bias a test design is subject to time-period bias if it based on a time period that may make the results time-period specific. Although the test covered a period extending more than 10 years, that period may be too short for testing an anomaly. Ideally, an analyst should test market anomalies over several business cycles to ensure that results are not period specific.

Look- Ahead Bias and Trading Cost

It is said the devil lives in the details. When it comes to texting rules, this truth applies. There are two more items that must be considered to ensure accurate historical testing. They are:

  • the look- ahead bias and related issue, assumed execution prices
  • trading cost

For example, suppose a rule uses the market's closing price or any input series that only becomes known at the time of the close. When this is the case, it would not be legitimate to assume that one could enter or exit a position at the market's closing price. Assuming this would infect the results with look- ahead bias. In fact, the earliest opportunity to enter or exit would be the following day's opening price. Therefore, the rule tests assume execution at the opening price on the following day. This means that a rule's daily return for the current day is equal to the rule's output value as of the close of day multiplied by the market's change from the opening price of the next day price to the opening price on day after that[3].

Footnotes

  1. E. Chan 2013, p.43
  2. R.A. DeFusco, D.W. McLeavey, J.E. Pinto 2015, p.273-274
  3. CMT Level I 2018: An Introduction to Technical Analysis 2018, p.491

References

Author: Ewa Szczyrbak