Is Trading the Golden Cross Profitable?

Introducing 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 buying a breakout after a particular type of consolidation. We then research our answers by following the steps to the good old fashioned scientific method:

  1. Observe the market
  2. Form a hypothesis
  3. Ask a question
  4. Gather our data
  5. Write the code
  6. Conduct the experiment
  7. Analyze the results
  8. Draw conclusions

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 first episode, we explore and evaluate the golden cross trading strategy by asking two questions:

  1. Is trading the golden cross profitable?
  2. If it is, is it worth trading?

We ask the follow-up question (2) because a strategy can be profitable but that doesn’t mean it’s better than alternative investment choices like a 60/40 portfolio or other market timing strategies.

What is the golden cross?

The golden cross involves the two most popular technical indicators traders use on their charts: a 50-day and a 200-day moving average. A golden cross is said to occur when the short-term moving average (50-day) crosses above the long-term (200-day) moving average.

Beyond the Charts- Is trading the golden cross profitable?

CNBC airing an S&P500 golden cross chart.

In contrast, a death cross happens when the short-term moving average crosses below the long-term moving average. Golden crosses and death crosses can occur on any underlying stock but it is most widely watched on the major market indices.

Today, we are going to code a strategy from scratch which executes trades when golden crosses and death crosses occur.

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 golden cross strategy

The strategy is composed of five key methods:

  • OnBarUpdate(): the main strategy method
  • BuySellRules(): defines the trading rules:
    • Buy when golden cross occurs (50-day moving average crosses above 200-day moving average)
    • Exit the long position when death cross occurs (50-day moving average crosses below 200-day moving average)
  • ComputeShareSize(): calculate the number of shares to purchase using 100% of the current account equity
  • CalculatePerformance(): track running realized and unrealized profit as well as the current account balance
  • OutputPerformance(): print out dates and balances to the output window for analysis

How we set up the golden cross testing environment

Golden cross test Parameters
Testing universe DIA ETF (total return)
Timeframe Daily
Backtest 1 13 years: 2005 to 2018
Backtest 2 20 years: 2000 to 2020
Slippage 2 cents
Starting balance $10,000

 

Golden cross strategy backtest 1: October 2005 – December 2018

During our first backtest between October 2005 and December 2018, the golden cross strategy yielded some pretty strong results. We began the test with a $10,000 hypothetical account balance, assume 100% invested on each signal, with no shorting on death crosses, only exits of our long position.

Here were the results:

Is trading the golden cross profitable? - Image of Backtest 1 performance

Not sure how to interpret some of these measurements? Head on over to our trading system performance glossary.

You can see the ending balance of our strategy versus our buy and hold benchmark ended with very similar values ($29,679 versus $30,791) but it managed to achieve those returns with a significantly smaller max drawdown (-20.3% versus -51.70%) and a much improved Sharpe ratio (0.70 versus 0.48).

The primary driver of this risk-adjusted outperformance for the golden cross strategy was sidestepping the bear market of 2008. These results look good, so we set out to run another test pulling in more historical data.

Golden cross strategy backtest 2: October 2000 – June 2020

This backtest almost doubles our testing period and includes major market events such as the tech bubble and bear market in the early 2000s and the fastest drop in stock market history from all-time highs into a bear market in the first quarter of 2020.

Is trading the golden cross profitable? - Image of Backtest 2 performance

What you’ll notice immediately is that both the strategy and benchmark compound annual growth rate (CAGR) dropped from our first backtest with the benchmark falling from 8.90% to 6.5% and the strategy from 8.60% to 3.90%.

What was equally disappointing to see from the strategy perspective was the defensiveness or risk-adjusted qualities that it had in our first test also deteriorated. The maximum drawdown nearly doubled from -20.30% to  -39.1% while the benchmark stayed consistent with our first test.

This additional market data gave the golden cross strategy difficulties in both the bear market of the 2000-2002 period as well as the 2020 COVID-19 bear market.

Here’s how the equity curves stack up between the strategy and benchmark over this 20-year time period:

Is trading the golden cross profitable? - Image of Backtest 2 Equity Curve

Is trading the golden cross a profitable strategy?

Yes – in both tests over the past 20 years of market data using the Dow Jones Industrial Average the strategy generated a profit.

Is it worth trading or investing in the golden cross strategy?

If we had stopped testing after our first 13-year backtest then we probably could have had a yes to this question as well given the strong risk-adjusted performance profile.

However, after we pulled in more data and observed the strategy over new market environments we can see the golden cross isn’t as robust as it initially appeared.

The golden cross is a trend following market timing strategy and our second test shows where this type of system has some difficulties: choppy sideways market environments, and extreme v-shape moves in a short period of time.

Ultimately, we believe there are better options out there to invest in over this particular timing strategy.

Final thoughts

The golden cross and death cross have long had great bull and bear market narratives associated with them, so that means you’re probably going to continue to see lots of dramatic and overstated headlines when they occur in the future. But now you know that if you were to follow those signals and trade the crosses like we did in this experiment you might be left quite disappointed with your returns over the long-term.

Of course, there are many more time periods and markets you would want to continue your research with, so if you want to learn and test more, be sure to download our strategy code to continue your investigation.

I hope you enjoyed the experiment. If you have any questions, comments, or feedback for future Beyond the Charts episodes, please leave us a comment below.

Enjoy what you read? Share it below and be sure to tag @thetraderisk.

Evan Medeiros

Evan is the founder of The Trade Risk, a financial media company that publishes research and analysis about the stock market and specializes in trading education. With 20+ years of coding experience and a B.S. in computer science, Evan brings a systematic discipline to investing in the stock market.

Don't miss out on more educational articles just like this!

Please enter your name.
Please enter a valid email address.
Something went wrong. Please check your entries and try again.

3 Comments

  1. Todd Katz on 10:59 am July 18, 2020 at 10:59 am

    Super interesting and also surprising results. Thank you!

  2. filipppo on 1:26 am August 6, 2020 at 1:26 am

    Interesting..
    if we add a short strategy (sell and then short when death cross occurs), can we improve the strategy in long market?

    • Evan Medeiros on 7:52 pm August 6, 2020 at 7:52 pm

      It’s a good idea, but no, adding a flip and sell short rule when a death cross occurs actually loses a considerable amount of money over this 20 year testing period.

Leave a Comment