Is Buying Stocks Trading at 52-Week Highs a Profitable Trading Strategy?
About Beyond The Charts
Welcome to the Trade Risk’s brand new educational series, Beyond the Charts! It is designed to give you insights into our research process, which for nearly a decade has helped fine-tune our expertise and products, such as the market-beating Merlin trading strategy.
We start by asking questions as broad as, “Is there really such a thing as a Santa Claus rally?” to as specific as,”does buying a breakout after a particular type of consolidation lead to profits?” We then research our answers by gathering historical market data, writing code, and analyzing the results.
We hope the technical tools and code we’ll share with you throughout this series will help you become a more informed investor and, please note, the conclusions we draw throughout this series should be seen only as a starting point to additional independent research.
Today’s experiment
In this episode, we’re digging into stocks that are breaking out to new 52-week highs to find out if buying them can lead to profitable trading results. The question we are setting out to answer is: Can buying stocks setting new 52-week highs lead to a profitable trading strategy?
What are 52-week highs?
52-week highs is a term used for stocks that are trading at their highest price over the past one year. The list of stocks at 52-week highs is a very popular watchlist that lots of investors track on a daily basis. The stocks that show up here are usually pretty well-known and highly mentioned across FinTwit and financial media sites.

Example of Yahoo Finance’s daily 52-week high watchlist.
Today, we are going to code a strategy to see what all the fuss is about. Can we profit from these stocks as soon as they start showing up on the 52-week high list?
Tools & resources used in this experiment
- NinjaTrader 8: This is the backtesting platform we’ll be using to generate our signals and test our strategy.
- Microsoft Excel: After we run our strategy in NinjaTrader, we’ll export the reports to Excel and analyze results.
- Norgate: This is where our data comes from for this experiment and it’s our recommended source for building and testing strategies (affiliate/referral link).
- Github: All of the strategy code can be found and downloaded here.
The in-depth tutorial
The following video lesson is where we go into all of the detail setting up the experiment, writing the code, and using our various tools and programs. If you want the in-depth walkthrough, we recommend continuing from this point on with the video. We also have timestamps in the description of the video in case you want to jump around.
How we constructed the 52-week high trading strategy
The strategy is composed of five key methods:
- OnBarUpdate(): the main strategy method.
- BuySellRules(): defines the trading rules:
- Enter a long position when today’s price is greater than or equal to the 252-day high and we have no current holding.
- ClosedAtFiftyTwoWeekHighs(): returns a true or false value depending on whether or not today is a new 252-day high.
- ComputeShareSize(): calculate the number of shares to purchase using 100% of the current account equity.
- OnExecutionUpdate(): logs the trading activity when buys and sells occur and keeps track of running performance.
How we set up the 52-week high trading strategy backtest
52-week high buy and trend follow | Parameters |
---|---|
Testing universe | Dow Jones Industrial Average Components |
Timeframe | Daily |
Dates tested | January 2000 to August 2020 |
Backtest 1 | 5% trailing stop loss |
Backtest 2 | 10% trailing stop loss |
Backtest 3 | 15% trailing stop loss |
Slippage | 2 cents |
52-week high strategy backtest with 5% trailing stop loss
In our first backtest, we simulate a 52-week high trading strategy that buys stocks after they close at fresh 52-week highs and then use a 5% trailing stop loss to exit the position.
No profit targets, we only exit the position after the stock falls 5% from our entry price or its new highs price after it began working in our favor.
Here were the results:
Not sure how to interpret some of these measurements? Head on over to our trading system performance glossary.
Nearly 2,000 trades across 20 years and a 38.40% win rate with an average 6.04% winning trade and a -3.06% losing trade. Not wildly profitable but it was still a positive outcome.
52 week-high strategy backtest with 10% trailing stop loss
The next test we ran was increasing the stop loss distance to 10% to see how much of an impact that has on results. Right off the bat, we noticed a big difference in the total number of trades, as they got cut in half down to 905 from 1927:
We also observed a higher win percentage of trades, a larger average win-to-loss ratio, and most importantly, more net cumulative profit.
52-week high strategy backtest with 15% trailing stop loss
In our final test, we decided to increase the stop loss one more time to 15%. Once again, we observed fewer trades, a higher percentage of profitable trades, and a bigger win-to-loss ratio at just over 3 to 1:
Also, take a look at the largest three winners from this test: over a 200% gain was captured thanks to having those wide stop losses, which helps avoid getting stopped out on routine price corrections.
Is Buying Stocks Trading at 52-Week Highs a Profitable Trading Strategy?
Yes — in all three of these tests we observed a net profitable outcome with each subsequent backtest more profitable than the prior. Buying stocks at 52-week highs is a form of momentum and there’s lots of evidence and research out there that supports this factor despite the counter-intuitive nature of “buying stocks at highs”.
Because our tests were limited to the Dow Jones Industrial Average components and a 20-year testing period, expanding the tests beyond this set of stocks and time horizons would be the logical next steps to build more confidence in this type of strategy.
While conducting this experiment, we also had two additional takeaways:
- Evidence shows that wider stop losses have the potential to improve overall results.
- A trader will need to be able to endure long stretches of sideways (no performance) for months and even years at a time if they plan to trade this type of strategy. This is something we discuss more in the video.
I hope you enjoyed this month’s experiment.
Were these results surprising to you? Do you trade breakouts, momentum, or 52-week highs? I’d love to hear your feedback and thoughts in the comments below.
Good luck out there!
Enjoy what you read? Share it below and be sure to tag @thetraderisk.
Posted in Article, Research, Trading Education, Trading Strategy
Tagged with Backtests, Beyond the Charts, Breakouts, Entries and Exits, Microsoft Excel, NinjaTrader, Stop Losses, Systematic Trading, Technical Analysis, Trend Following, Video Lesson
Interesting stats, thank you for sharing. This obviously is very encouraging for an investor whose FP wants to diversify and hold. This the 15% swing. I think to your point an investor with this strategy has to be patient during the sideways movement and the dips. My question is if you are paying 1.5% – 2% to manage this, why not do it yourself and pick several SPDR sectors or equivalent from less expensive funds like Schwab ie equivalent and monitor them bi-annual. Good info thank you.
Hi Steve,
You’re right, I don’t think I would personally want to pay 1 to 2% management fee for this type of strategy. It just doesn’t quite have a strong enough unique return driver to justify those fees. I’m not sure I fully understand your comment on the SPDR sector ETFs, but if you’re asking about running this 52-week high breakout strategy on them, you absolutely could, but I’m not sure that small universe would generate enough trades for you to beat buy and hold.
Thank you, Evan, for the interesting data and clear explanation. I was wondering if the trend of higher average returns and better win-to-loss ratio would continue had you run a 20, 25, or even a 50% trailing stop-loss experiment. Also, have you ever compared them to a buy-and-hold strategy? I’d wonder what those results would have been.
Also, how does the Cumulative Return translate into an average annual return?
Thank you again
Hi Max,
Glad you enjoyed the experiment and good follow-up questions. I haven’t run the tests at 20%+ trailing stops, but my strong suspicion is that the win percentage and cumulative R returns would continue to increase. However, what would also increase is the drawdown and overall volatility in the portfolio. Returns would also start to exhibit a diminishing effect, ie. 40% stop versus 50% stop might yield only very small additional total returns (while introducing a lot more downside risk).
Translating cumulative return into average annual return or CAGR would require settling on a position sizing equation for each trade. Do we want to allocate 10% of our portfolio to each signal or maybe 20%? That would be the next progression and round of questions we would need to answer in order to turn this into a complete trading system which we could then compare against buy and hold.
Hope that helps!
Thank you, Evan. I always think about the study that Fidelity has done as to which accounts had done the best at Fidelity. They found that the accounts of people who forgot they even had an account had the highest returns.
It’s really sobering to realize that we might be actually shooting ourselves in the foot by spending countless hours devising and implementing investing strategies. That’s why I’m always curious about how different theories compare to “doing nothing”. But psychologically it’s hard to sit and watch your portfolio go through countless rollercoasters. I guess strategies give us (the illusion of) control.
Exactly right. For the far majority of people, autopiloting a low cost DCA index allocation and forgetting about it for a few decades is definitely the best approach. However, once folks start getting close to retirement or need to focus on capital preservation, simple market timing solutions to manage risk and reduce drawdowns similar to this start to add a lot more value.
Evan,
Why would changing the stop loss Trail % change the number of trades? Unclear how the Stop loss % reduced the number of trades.
Thanks,
JBJ
Hi JBJ,
It’s because stop outs happen more frequently when you use smaller trailing stop loss percentages, which means you have to buy back into the trade again if it turns around and makes a new 52W high. Quick example to illustrate: let’s say you buy AAPL stock at 52-week highs with a 5% trailing stop loss. Two weeks later AAPL pulls back 6% causing you to stop (exit) the trade. A week after your stop out, AAPL resumes its uptrend and makes a fresh 52-week high, which triggers a buy signal for you to get back in.
Compare that to someone who used a 10% trailing stop loss for AAPL and was never stopped out in the first place and therefore didn’t have to make that extra trade.
Hopefully that helps.