Testing a Youtube MACD Strategy

In previous articles, I’ve tested moving average crossovers and bounces.

But I didn’t test this famous (or infamous?) indicator related to them…

The MACD.

When I saw a video from TradingLab on Youtube called “BEST MACD Strategy,” I was curious to test his approach.


What’s a MACD Daddy-o?

It stands for Moving Averages Convergence Divergence. It’s meant to help us see momentum in the market.

So we take a shorter-duration moving average and pair it up with a longer one.

We then graph the difference between the two as its own line.

We also plot an MA of the difference, called the “signal” line.

When the signal line crosses over the difference line, we might be seeing a shift in direction.

The farther the signal line pushes away from the other, the stronger the momentum is in that direction.

Note: most charting software, including TradingView, also shows the difference as bars (a histogram).

So how are we gonna test this thing?


The Trading Truth Test Setup

We’re keeping the market and the test period the same as some of the previous tests, for easier comparison.

(The TradingLab video just says MACD works in many markets and timeframes, without limiting it to one for testing.)

  • Market: the S&P 500 index (using SPY to trade it, assuming SPY is exactly 1/10th the S&P 500 Index price)

  • Timeframe: Jan 2, 2008 to March 28, 2023

  • Bar interval: 1 hour

  • Moving averages: Unlike previous tests, where we used simple moving averages, we’re using exponential moving average here to weight recent prices more.

    We use a 200 exponential moving average for overall trend direction.

    For the MACD, we’re using the classic 12 bars and 26 bars to see the difference between them. And we’re the normal 9-bar MA of that difference as the signal line.

  • Starting Equity: $ 25,000

  • Max % of Equity Per Trade: 3%

  • Commissions, fees and taxes. To keep things super simple, we’re assuming these are all zero.



Our Test

When we get a MACD crossover between the signal line and the difference line, we look to go long.

But we only go long if:
  • the last closing price is above the 200 MA, and

  • When an upside MACD crossover (the signal line crossing up through the difference line) happens below its zero line (the lower half of the plotted indicator area).


We do the opposite to go short…

We short when price closes below the 200 MA and we get a downside MACD crossover above the zero line.

Our stop loss is 1 penny past the 200 MA value when entering the trade.

And our take-profit price is the difference between the entry price and the 200 MA (on entry) multiplied by 1.5. That’s the suggestion in the TradingLab video.

Note: The Youtube video suggests using support and resistance as another filter to avoid choppy markets. But there aren’t clear rules given, so I didn’t do that.


The Test Results

The test ended at $ 30,401.39, up 21.6% with a 46.9% win rate.

The biggest loss from the initial $ 25,000 deposit was $ 270.85, a 1.1% loss.

The maximum losing streak was $ 800.22 or 3.0% (from $ 26,908.66).

That said, the buy-and-hold return was 173.1%.

Quite a reward for sitting on your hands, especially given the tax advantages from long-term capital gains.

Note: I did this analysis in a spreadsheet, with exported TradingView data. If you see any errors, please let me know.


What Test Tweaks We Could Make

We could identify rules on when to stay out of the market.

MACD strategies, like many, get chopped up in sideways price action.

Some other MACD settings might also be interesting to test. We used only the most common settings here.

What would you test? And what else would you like to see tested?

Comment below!
backtestbacktestingmacdcrossoverMoving AveragesOscillatorsstrategystrategytesterstrategytestingtesting

También en:

Publicaciones relacionadas

Exención de responsabilidad