Backtest Results For A Simple "Buy the Dip" Strategy

Exciting News: Paid Subscriptions Have Launched! 🚀

On September 1, we officially rolled out our new paid subscription plans at GuruFinance Insights, offering you the chance to take your investing journey to the next level! Whether you're just starting or are a seasoned trader, these plans are packed with exclusive trading strategies, in-depth research paper analysis, ad-free content, monthly AMA sessions, coding tutorials for automating trading strategies, and much more.

Our three tailored plans—Starter Investor, Pro Trader, and Elite Investor—provide a range of valuable tools and personalized support to suit different needs and goals. Don’t miss this opportunity to get real-time trade alerts, access to masterclasses, one-on-one strategy consultations, and be part of our private community group. Click here to explore the plans and see how becoming a premium member can elevate your investment strategy!

đź—Ł Stock Market Today: Norfolk Southern says investigating CEO over alleged misconduct

Norfolk Southern (NSC.N) has initiated an investigation into its CEO, Alan Shaw, following allegations of potential misconduct involving an inappropriate workplace relationship. The company's audit committee is collaborating with a law firm to conduct an independent inquiry into the matter. Shaw, who became CEO in May 2022, has not yet commented on the investigation. This development follows a recent activist investor push by Ancora, which won three board seats earlier this year but failed to remove Shaw as CEO. Ancora had sought to replace Shaw with Jim Barber, a former COO at UPS, arguing that new leadership was needed to enhance the company's financial and operational performance.

Norfolk Southern, based in Atlanta, Georgia, reported operating revenue of $3 billion for the second quarter, a 2% increase from the previous year but slightly below analysts' expectations of $3.04 billion. Ancora has stated that it will continue to hold the company accountable for any future underperformance or incidents, signaling ongoing scrutiny of the railway operator's leadership and operations.

Stay informed with today's rundown:

Today, we will dive into “Backtest Results For A Simple "Buy the Dip" Strategy”

Backtest Results For A Simple “Buy the Dip” Strategy

I came across this trading strategy quite a while ago, and decided to revisit it and do some backtesting, with impressive results, so I wanted to share it and see if there’s anything I missed or any improvements that can be made to it.

If You Missed

Concept:

Strategy concept is quite simple: If the day’s close is near the bottom of the range, the next day is more likely to be an upwards move.

Setup steps are:

Step 1: Calculate the current day’s range (Range = High — Low)

Step 2: Calculate the “close distance”, i.e. distance between the close and the low (Dist = Close — Low)

Step 3: Convert the “close distance” from step 2 into a percentage ([Dist / Range] * 100)

This close distance percentage number tells you how near the close is to the bottom of the day’s range.

Analysis:

To verify the concept, I ran a test in python on 20 years worth of S&P 500 data. I tested a range of distances between the close and the low and measured the probability of the next day being an upwards move.

This is the result. The x axis is the close distance percentage from 5 to 100%. The y axis is the win rate. The horizontal orange line is the benchmark “buy and hold strategy” and the light blue line is the strategy line.

Close distance VS win percentage

What this shows is that as the “close distance percentage” decreases, the win rate increases.

Backtest:

I then took this further into an actual backtest, using the same 20 years of S&P500 data. To keep the backtest simple, I defined a threshold of 20% that the “close distance” has to be below. If it is, then that’s a signal to go long so I buy at the close of that day and exit at the close of the next day. I also backtested a buy and hold strategy to compare against and these are the results:

Balance over time. Cyan is buy and hold, green is buy dips strategy

Benchmark vs strategy metrics.

The results are quite positive. Not only does the strategy beat buy and hold, it also comes out with a lower drawdown, protecting the capital better. It is also only in the market 19% of the time, so the money is available the rest of the time to be used on other strategies.

Overfitting

There is always a risk of overfitting with this kind of backtest, so one additional step I took was to apply this same backtest across a few other indices. In total I ran this on the S&P, Dow Jones, Nasdaq composite, Russel and Nikkei. The results below show the comparison between the buy and hold (Blue) and the strategy (yellow), showing that the strategy outperformed in every test.

Caveats

While the results look promising, there are a few things to consider.

  1. Trading fees/commission/slippage not accounted for and likely to impact results

  2. Entries and exits are on the close. Realistically the trades would need to be entered a few minutes before the close, which may not always be possible and may affect the results

Final thoughts

This definitely seems to have potential so it’s a strategy that I would be keen to test on live data with a demo account for a few months. This will give a much better idea of the performance and whether there is indeed an edge.

Does anyone have experience with a strategy like this or with buying dips in general?

More Info

This post is long enough as it is, so for a more detailed explanation I have linked the code and a video below:

Video explaining the strategy, code and backtest here: https://youtu.be/rhjf6PCtSWw

Reply

or to participate.