Originally published at: Using Delisted Stocks for Backtesting a 3-EMA Strategy with Python | EODHD APIs Academy
The Exponential Moving Average (EMA) is one of the most widely used technical indicators in the trading world, yet in most cases, it is not used to its full potential. People are still using generic strategies like the EMA 50 & 200 crossover which is not a bad thing but since it’s overused by a lot of traders, its commonality has deteriorated the strategy’s efficiency. Today, we are going to explore a new EMA crossover strategy and check if it beats the market by outperforming the results of the buy/hold strategy. But there’s a catch. We’re going to backtest the strategy on delisted stocks. Why? Because the price movements of delisted stocks are more volatile than of listed stocks, giving…
You are introducing lookahead bias by using delisted stocks posteriori
Thank you for your comment. You are correct that using delisted stocks can introduce lookahead bias. The purpose of this example was to illustrate the mechanics of backtesting a 3-EMA strategy using available historical data, including delisted stocks. In practical applications, it is crucial to ensure that data reflects the information available at the time of trading to avoid such biases. We appreciate your feedback and will consider it for future improvements.