MACD – Test Results

The MACD is one of the most widely used technical indicators in the world and is included in every charting program worth owning.  Unfortunately however, reliable data on its performance is almost non-existent.  Are the standard settings of 26, 12, and 9 the best?  To reveal the answer we tested 2000 different combinations through 300 years of data across 16 different global markets~. Stand by for the results below…

 

Download A FREE Spreadsheet With Data, Charts

And Results For all 2,000 MACDs Tested

.

MACD – Test Results:

.

MACD Conclusion

.

Our Testing Strategy Explained

Because there are so many different possible settings for a MACD we started by testing a broad range with the hope this would reveal the areas to focus on more closely.  To cast our testing range wide but strategically, we progressed in a liner fashion through the Fast Moving Averages (FC) and set the Slow Moving Averages (SC) as of multiple of the FC:

Fast Moving Averages (FC) = 10, 20, 30, 40, 50
Slow Moving Averages (SC) = 2 * FC, 3 * FC, 4 * FC, 5 * FC, 6 * FC

So each of the five FC settings were tested against five SC settings based on a multiple of the FC. e.g  A SC of 50 would be tested against a FC of 100, 150, 200, 250, 300 as these are equal to 50 multiplied by 2, 3, 4, 5 and 6.

Each of these were tested against 10 different Signal Line settings:

Signal Line (SL) = 2, 4, 6, 8, 10, 12, 14, 16, 18, 20

Trading Rules:

An entry signal to go Long for each MACD tested was generated when the MACD Line was above zero AND above the Signal Line.  The position was closed when the MACD Line moved below zero OR below the Signal Line (vice versa when going short)^.

If what you have read so far does not make much sense, please read more about the MACD before continuing 🙂

.

MACD Test Sets – Broad

MACD, EOD Long - Annualized Return During Exposure

Above you can see the annualized return during the time each MACD was exposed Long to the market.  Clearly the Signal Line setting is far more influential than the ‘Fast’ and ‘Slow’ Moving Averages (MACD Line).  To my surprise having the Signal Line as fast as just 2 days produced the the best results and even more surprising is that the trades produced are not prohibitively short (8 – 27 days on average from the table above, see spreadsheet for full stats).

Return to Top

.

MACD Test Sets – Short Term Trading

MACD EOD, Long - Annualized Return During Exposure

After refining the tests down several times we uncovered some interesting findings.  Firstly the most efficient returns came from a MACD with a ‘Fast’ Moving Average of 1, which isn’t actually a MACD at all (a Moving Average with a period of 1 is equal to the price itself).  So the best results come from measuring the Convergence and Divergence between an MA and the price, with the addition of a Signal Line.  What is really exciting however is this also works exceptionally well on the Short side of the market:

MACD EOD, Short - Annualized Return During Exposure

For me, when assessing a trading system, I am more interested in the return during exposure than the return overall.  A system may have you exposed to the market for 30%, 70% or 99% of the time but the more time you are exposed to the market the more time your money is at risk.  While my money is at risk, if it is not working hard, if I am not getting a high return, then I would rather sit in cash!

The Short side of the market is often not worth trading because decent returns during exposure are difficult to get from a mechanical system.  What we see with the MACD however are returns during exposure then exceed even the best that the FRAMA could produce when Long….  Sooooo, what is the catch?  Lets have a closer look:

MACD EOD 1, 56 Long and Short, Sig 2

The pink line on the chart above is the performance, taking signals both Long and Short from a MACD with a ‘Fast’ MA of 1 (price), a ‘Slow’ MA of 56 and a Signal Line of 2.  I have included the results from the best FRAMA for comparison.

The impressiveness of this MACD can’t be doubted; consider the fact that it achieves these returns while only being exposed to the market 56% of the time and delivers a 42% probability of profit for each trade.  But can you see the problems?  With an average return of just 0.25% and an average trade duration of 4 days, a MACD with these settings is limited in its practical applications.

Firstly you would need near frictionless trading, such as that offered by some index mutual funds (e.g. Rydex, ProFunds, or Direxion)

Secondly you would need to gain exposure to several diverse equity index funds.  Part of the reason for the success of this strategy is the fact that it spreads the risk across 16 different global markets, some of which performed better than others in our tests.  In the real world frictionless trading is not accessible to such a variety of indices.

Thirdly between 2003 and 2007 while the Global Average was experiencing a very strong bull market the MACD underperformed quite significantly.

Return to Top

.

MACD Test Sets – Practical Trades: Long

MACD EOD, Long - Annualized Return During Exposure

The table above is the result of a search for some more practical MACD settings.  As you can see the best returns localise around the the 21/81 mark area:

MACD EOD 21, 81 Long, 2

Above we are looking at the performance of a MACD going Long with a ‘Fast’ Moving Average of 21, a ‘Slow’ Moving Average of 81 and a signal line of 2 compared to the best FRAMA (also notice the poor performance from the standard MACD of 12, 26, 9 – See Full Stats).

Now when comparing the 21, 81, 2 MACD to the FRAMA it must be taken into consideration that the MACD is only exposed to the market 35% of the time while the FRAMA is exposed 57% of the time.  So a side by side, total return comparison is not really fair.  What is good to see however is the consistency and stability from the MACD during market declines.  What I don’t like though is the familiar under-performance during the strong bull market between 2003 and 2007.

Return to Top

.

MACD Test Sets – Practical Trades Short

MACD EOD, Short - Annualized Return During Exposure
The Short side of the market behaves differently to the Long so it is not surprising to see that a more reactive MACD performs better, and the top returns were found around 16/97:

MACD EOD 16, 97 Short, 2

Above we are looking at the performance of a MACD going Short with a ‘Fast’ Moving Average of 16, a ‘Slow’ Moving Average of 97 and a signal line of 2 compared to the best FRAMA (also included is the standard MACD of 12, 26, 9 – See Full Stats).

The 16, 97, 2 MACD is quite exceptional, managing to match the returns from the FRAMA with 2/3 the market exposure and a higher probability of profit.  These results are very exciting.  It would appear as though the MACD’s true strength is in its ability to go Short.

Return to Top

.

MACD Conclusion

I have been a big fan of the MACD for a long time and had high expectations for these test results.  But reality has been harsh on the MACD and in many ways the Emperor has no clothes.

In an attempt to limit the length of this article we only published results from trades off the Signal Line when the MACD line was above zero (when Long) or below zero (when short).  Please note however that trying the trade the MACD when it is on the wrong side of zero will lead to an unhappy bank account, an unhappy wife and an unhappy life.

As a tool for long term trading the MACD fails and can’t compete with its less evolved relative the Moving Average Crossover.

As a tool for short term trading (4 days on average) the MACD is very powerful in theory but with such a small average return the practical applications are limited.

As a tool for medium term trading the MACD should not be your first choice on the Long side of the market BUT on the Short side the MACD is simply outstanding!  Using a ‘Fast’ Moving Average of 16, a ‘Slow’ Moving Average of 97 and a signal line of 2 you have a powerful indicator for taming the bear.

 

More in this series:

We have conducted and continue to conduct extensive tests on a variety of technical indicators. See how they perform and which reveal themselves as the best in the Technical Indicator Fight for Supremacy.

 

Return to Top

  • ~The data used for these tests is included in the results spreadsheet and more details about our methodology can be found here.
  • ^ No interest was earned while in cash and no allowance has been made for transaction costs or slippage.  Trades were tested using End Of Day (EOD) signals on Daily data.  All Moving Averages (MA) in these tests were Exponential (EMA).

Oscillator Classification

  • Absolute Price Oscillator (APO) deals with moving averages of actual prices such as the MACD.
  • Percentage Price Oscillator (PPO) computes the difference between two moving averages on a normalized basis by percentage.  There are several different methods for this including:
    1. Taking calculations on price percentage changes.
    2. Taking the difference between two moving averages and dividing them by the longer moving average value.
    3. Taking the difference between two moving averages and dividing them by the Average True Range (ATR)

All of the PPO methods produce the same signals however they allow you to compare securities of different prices or the same security during different time periods.  Dividing by the ATR is particularly useful when comparing different asset classes or securities of vastly different volatility.

Moving Average Convergence Divergence (MACD)

MACD stands for Moving Average Convergence Divergence and was first developed by Gerald Appel in the late 1970s.  It is an Absolute Price Oscillator (APO) and can be used in an attempt to identify changes in market direction, strength and momentum.

It calculates the convergence and divergence between a ‘fast’ and a ‘slow’ Exponential Moving Average (EMA) known as the MACD Line.  A signal EMA is then plotted over the MACD Line to show buy/sell opportunities.  Appel specified the MA lengths as the following percentages:

Slow EMA        =     7.5%    (25.67 period EMA)
Fast EMA        =    15%      (12.33 period EMA)
Signal EMA     =    20%       (9 period EMA)

Usually however these are rounded to EMAs of 26, 12 and 9 respectively.  Many charting packages will also plot the difference between the Signal Line and MACD Line as a Histogram.

One of the biggest challenges when dealing with financial data is noise or erratic movements that cause false signals.  By smoothing data out you can reduce the number of false signals.  But this comes at a cost, and causes an increase in the lag of your signals.  The genius of the MACD is that it begins by smoothing data (thus causing lag) and then speeds up the signals from the smoothed data.  This combination helps to reduce false signals while minimising the lag.

By comparing EMAs of different lengths the MACD can help to identify subtle changes in the trend and momentum of a security.  It is a great visual representation of the acceleration or rate of change in a trend.

 

MACD Example

 

How to Calculate a MACD

MACD Formula:

MACD Line = EMA,12 – EMA,26
Signal Line = EMA[MACD,9]
MACD Histogram = MACD – Signal Line
Histogram Trigger = EMA[MACD Histo,5]

Obviously you can change the parameters to any value of your choice.

 

MACD Excel File

We have put together an Excel Spreadsheet that will automatically adjust to the MACD settings you desire.  Find it at the following link near the bottom of the page under Downloads – Technical Indicators: Moving Average Convergence Divergence (MACD)

 

Test Results

Is the MACD an effective indicator?  We are putting it into the ring for the Technical Indicator Fight for Supremacy.  It will be tested through 300 years of data across 16 global markets to discover which settings produce the best results and how it performs compared to other indicators:

  1. Moving Average Crossovers – Completed – Golden Cross – Which is the best?
  2. Moving Average Convergence Divergence (MACD) – CompletedResults
  3. ZeroLag MACD (ZL-MACD)
  4. MACD Z Score (MAC-Z)

 

CompletedResults

Technical Indicator – Fight for Supremacy

Which Technical Indicators are Best?There are a vast number of technical indicators out there but which ones are best?  Are any of them suitable for use in a mechanical trading model?  Do any of them actually provide value over a buy and hold approach?  In my experience most of the publicly available technical indicators are of little, if any value.  All of our best performing models are build on completely new ideas that deviate from conventional approaches to technical analysis almost entirely.

But questions remain: what length of moving average provides the best signals?  Is it better to use a simple or exponential moving average?  Quality answers to these questions are few and far between and often the process people use to establish such answers are majorly flawed.

.

Common Flaws in Testing Technical Indicators and Systems

.

  • Curve Fitting – Only Testing On One Stock or Index (usually the S&P 500) Even if a test period covers many years of data to only test one index will produce results that fit that curve.  Also the US market has been one of the top performers over the last 100 years but will it be a top performer over the next 100?  Japan has experienced a bear market over the last 20 years so vicious that it has seen the the Nikkei 225 down over 80% from its peak.  To get an accurate idea of the effectiveness of an indicator it must be tested on several unrelated securities across the full spectrum of performance possibilities..
  • Testing A Range Of Individual Securities There are several misleading factors that come from testing a range of individual securities, the most troublesome one being the survivor-ship bias.  If I was to test a random selection of stocks then one necessary criteria would be to select from a group of stocks that had been around long enough to provide adequate data for testing.  But by selecting from stocks with enough data I would only be selecting randomly from stocks that had survived over that period and would be ignoring those that failed or had been de-listed.  This is not how things work in the real world and would produce artificially inflated results..Another challenge with testing idividual securities is choosing the sellection criteria for which stocks to include.  At which point should a cut off be made based on price, volume, market cap etc?  Some stocks are going to have an excess or lack of volatility and there may be a large amount of noise in the data.  This will make it difficult for even the best technical indicators to produce profitable signals and to limit losses.

.

A Less Flawed Method

.

There is no perfect way to test an indicator or system using historical data because past performance is no guarantee of future results.  However the markets are driven by human emotion and crowd psychology.  I believe that this behavior follows repeated patters and that effective historical testing can identify these patterns.  In this way we can look to the past for an indication of the likely future.

In an attempt to be more effective at identifying patterns that are likely to repeat as opposed to coincidental repetition of behavior from the past, we will test across several global indexes that have many years of accurate data available.  This way there is no survivor-ship bias and each indicator can be tested through varying market types.  Here is a list of the 16 global indexes that will be used for the testing process along with the data range for each:

.

Technical Indicator Test Periods

.

That is a total 109,539 days or 300 years* of data covering extended bull, bear and crab markets.  I am confident that due to the size of this data sample identifying the best parameters for each indicator through brute force of testing them all will not result in curve fitting and the statistics obtained will provide an accurate platform for a bare knuckle, Technical Indicator – Fight for Supremacy.^

.

Human psychology molds the value system that drives a competitive market economy.  And that process is inextricably linked to human nature, which appears essentially immutable and, thus, anchors the future to the past. – Former Fed Chief Alan Greenspan

.

Technical Indicators On The Fight Card (So far) – more

.

Moving Averages – info

.

 

  • Simple Vs Exponential Moving Averages, CompletedResults
  1. Simple Moving Average (SMA)
  2. Exponential Moving Average (EMA)
  3. Double Exponential Moving Average (D-EMA)

.

  • Double Vs Triple Exponential Moving Average, CompletedResults
  1. Double Exponential Moving Average (D-EMA)
  2. Triple Exponential Moving Average (T-EMA)

.

  • Reduced Lag Moving Averages
  1. Zero Lag EMA (ZL-EMA)
  2. Almost Zero Lag EMA (AZL-EMA)
  3. Zero Lag Error Correcting EMA (EC-EMA)
  4. Hull Moving Average (H-MA)
  5. Modified Moving Average (M-MA)
  6. 3rd Generation Moving Average (3G-MA)

.

  • Weighted Moving Averages, CompletedResults
  1. Weighted Moving Average (W-MA)
  2. Triangular Exponential Moving Average (TriW-MA)
  3. Sine Weighted Moving Average (SW-MA)

.

  • Mixed Moving Averages, CompletedResults
  1. Time Series Forecast or Moving Linear Regression (TSF)
  2. Linear Regression Indicator (LRI)
  3. Wilder’s Smoothing AKA Smoothed MA (WS-MA)
  4. Triangular Simple MA (TriS-MA)

.

Intelligent Moving Averages

.

These require a volatility index or ratio of some kind and we will be testing the following as components:

  1. Standard Deviation Ratio (SDR)
  2. Efficiency Ratio (ER)
  3. Relative Volatility Index (RVI)
  4. Vertical Horizontal Filter (VHF)
  5. Fractal Dimension (D)
  6. Z Score (ZS)
  7. Chaikin’s Volatility (CV) >
  8. Dreiss Choppiness Index (CI) >

> We currently lack High and Low Prices for some test markets.

.

 

  1. Standard Deviation RatioCompletedResults (SDR-VMA)
  2. Efficiency RatioCompletedResults (ER-VMA)
  3. Relative Volatility IndexCompletedResults (RVI-VMA)
  4. Vertical Horizontal FilterCompletedResults (VHF-VMA)
  5. Fractal Dimension CompletedResults (D-VMA) 
  1. Efficiency RatioCompletedResults (ER-AMA)
  2. Fractal DimensionCompletedResults (D-AMA)
  3. Standard Deviation RatioCompletedResults (SDR-AMA)
  4. Relative Volatility IndexCompletedResults (RVI-AMA)
  5. Vertical Horizontal FilterCompletedResults (VHF-AMA) 
  1. Fractal Adaptive Moving Average (FRAMA) CompletedResults
  2. Standard Deviation Ratio
  3. Efficiency Ratio
  4. Relative Volatility Index
  5. Vertical Horizontal Filter

.

  • Other Intelligent Moving Averages
  1. McGinley Dynamic Indicator
  2. MESA Adaptive Moving Average and Following Average FAMA (MAMA)

.

MACD

  1. Moving Average Crossovers – Completed – Golden Cross – Which is the best?
  2. Moving Average Convergence Divergence (MACD) – CompletedResults
  3. ZeroLag MACD (ZL-MACD)
  4. MACD Z Score (MAC-Z)

.

‘Index’ Indicators

  1. Relative Strength Index (RSI) – CompletedResults
  2. Relative Momentum Index (RMI)
  3. Dynamic Momentum Index (DMI)
  4. Relative Volatility Index (RVI)

.

Oscillators

  1. Stochastic Oscillator (SO)CompletedResults
  2. Stochastic Momentum Index (SMI)
  3. Projection Oscillator (PRO)
  4. Ultimate Oscillator (UO)
  5. Rolling EV Ratio (R-EVR)

.

Mixed Indicators

  1. Parabolic SAR (PSAR)
  2. Aroon (AN)
  3. Directional Movement (DM)
  4. Smoothing the Bollinger %b (SB%b)
  5. Vertical Horizontal Filter (VHF)

.

It is going to take a while to work through all of this and compile the data so we will update it regularly with the latest results.  Are there any indicators that you think we should add to the list or trading systems that you want tested? To be suitable for testing they must be able to produce clear entry and exit signals and not require volume data (we don’t yet have access to enough historical volume).  If you have any of the formulas that we are missing or wish to add an indicator to the fight card then the formula would be preferred in excel format.

And now… for the 1000s in attendance and the millions watching around the world, Ladies and Gentlemen, LLLLLET’S GET READY TO RUMBLE!

.

 

 

  • * Unless otherwise stated 104 weeks of data for each index has been ‘left in’ as lead time for indicators that require a lot of data to get their first signal such as a 50 week double exponential moving average.  On some occasions this lead time may not be enough and this could negatively affect the results for an indicator with a massive lead in time because the additional down time (the early 90s) was typically a bullish period globally.
  • ^ All testing has and will be performed mechanically and every effort is made to ensure accuracy but there is the possibility that some errors have over looked.  Please do your own research and remember that the information provided here is for entertainment purposes only.
Log Normal Moving Average