Look-Ahead Bias

From CEOpedia | Management online

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

Examples of Look-Ahead Bias

  • Using the future prices of a stock to predict the buy and sell signals of the current day: Look-ahead bias can occur when a backtesting program uses future prices of a stock to determine the buy and sell signals of the current day. This is because the future prices of a stock are unknown, and therefore cannot be used to make predictions about the current day's trading signals.
  • Using a days high or low price to determine the entry signal during backtesting: Look-ahead bias can occur when a backtesting program uses a day’s high or low price to determine the entry signal during backtesting. This is because a day’s high and low prices are not known until the close of the trading day, and therefore cannot be used to make predictions about the current day's trading signals.
  • Using future news or events to predict the current market: Look-ahead bias can occur when a backtesting program uses future news or events to predict the current market. This is because future news and events are unknown, and therefore cannot be used to make predictions about the current market.

Advantages of Look-Ahead Bias

Look-ahead bias can be advantageous in backtesting as it allows traders to evaluate their strategies using hypothetical future data. This can help traders identify potential opportunities while also testing out their strategies in a variety of market conditions. Some of the advantages of look-ahead bias in backtesting include:

  • Optimizing strategies to maximize profits: By using future market information, traders are able to make decisions based on what they expect the market to do in the future. This can help them optimize their strategies to maximize profits in future market conditions.
  • Highlighting risk-reward relationships: By testing different strategies with future information, traders can identify the risk-reward relationships associated with different strategies. This can help them identify strategies that are more likely to be profitable in future markets.
  • Improving strategy selection: By using future information, traders can more accurately evaluate their strategies and select the best ones for their specific trading goals. This can help them make more informed decisions when selecting strategies.

Limitations of Look-Ahead Bias

  • Look-ahead bias can significantly distort the results of a backtest. It can lead to inaccurate predictions and results that do not reflect the true performance of a trading strategy.
  • Look-ahead bias can lead to overfitting, as the backtest program is using information that may not be available in the real world.
  • Look-ahead bias can lead to unrealistic expectations about the performance of a trading strategy.
  • Look-ahead bias can create a false sense of security, as it may appear that a strategy is performing better than it actually is.
  • Look-ahead bias can lead to skewed results when comparing different strategies, as the backtest program is using information that may not be available to all strategies.

Other approaches related to Look-Ahead Bias

Look-Ahead Bias is a form of data snooping, which is when backtesting programs use future information to make predictions at the current time. Other approaches related to Look-Ahead Bias include:

  • Using tomorrow's trading volume to determine today's entry signals - This is a common approach used when backtesting, as it can give an indication of the direction of prices in the future.
  • Using tomorrow's price movements to determine today's entry signals - This approach is also used when backtesting, as it can give an indication of the direction of prices in the future.
  • Using tomorrow's price action to determine today's entry signals - This approach is also used when backtesting, as it can give an indication of the direction of prices in the future.
  • Using tomorrow's market sentiment to determine today's entry signals - This approach is also used when backtesting, as it can give an indication of the direction of prices in the future.

In summary, Look-Ahead Bias is a form of data snooping which can be used when backtesting programs to use future information to make predictions at the current time. Common approaches include using tomorrow's trading volume, price movements, price action, and market sentiment to determine today's entry signals.

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


Look-Ahead Biasrecommended articles
Overbought oversold indicatorBullish divergenceImplementation ShortfallTrading channelBear flagBull flagProfit TargetOsmaCapped Index

References

Author: Ewa Szczyrbak