Part II. Moving Average Convergence Divergence - MACD

Moving Average Convergence Divergence - MACD - Forex School
Commander in Pips: The next indicator that we will talk about is Moving Average Convergence Divergence, but it better known as MACD. So, we will refer to it in that way – MACD. Besides, you will understand this indicator more easily, because you are familiar with MAs already and MACD is based on them.

Pipruit: Yes, I’ve understood MAs well, at least better than your Bollinger Bands…​

Commander in Pips: Well, there you are.

MACD was born for trend identification - Forex School
Description of the MACD Indicator

The major task for using MACD is estimation of trend direction. Personally, this is my favorite indicator for that purposes. Also MACD could be used for some specific price behavior identification, such as bullish/bearish divergences and market Dynamic Pressure. But this is a bit advanced for now and we will talk about those uses in later chapters. Today our task is the basics of MACD.

As we said, MACD was born for trend identification – it extremely important for us, because trading with the trend is a primary task for any trading plan.

MACD could be plotted on the chart two ways – with two crossing lines overtime, or as a Histogram.

Chart #1 60-min EUR/USD and MACD (12; 26; 9)
MACD could be plotted on the chart two ways – with two crossing lines overtime - Forex School
This indicator has three input parameters:

1. Period for fast MA – let’s call it MA1. Usually in most software programs it has a value of 12 as default;

2. Period for slow MA - let’s call it MA2. Usually in most software programs it has a value of 26 as default;

3. Period for MA that averages and smooths difference between two previous ones - let’s call it MACDA (MACD Average). Usually in most software programs it has a value of 9 as default.

Pipruit: Wait a minute – you’ve said that it consists of two lines, but here we have three…​

Commander in Pips: Yes, but Lines of MACD that you see on the chart are not just the MAs that we’ve specified. If it will be so, then why we should use it – this is the same as a simple MAs. What’s the difference?

Pipruit: And so what are the lines then?

Chart #1 60-min EUR/USD and MACD (12; 26; 9)
The fast line of MACD indicator calculates as difference between MA1 and MA2 - Forex School
Commander in Pips: Look how it works:

1. The fast line of MACD indicator calculates as difference between MA1 and MA2:

MACD (line) = MA1-MA2.

This is the first line that you see

2. The second line that is slower is a moving average that calculates using MACD (line) – that difference between MA1-MA2. Other words it plots average difference between MA1 and MA2. And by appointing some parameter for MACDA – you exactly appoint number of such differences that will be averaged by this third line:

MACDA = Moving average on (MA1-MA2).

That’s the second line.

Although those two lines look like a simple MA crossing – the way of calculation gives significant advantages when you apply MACD.

Pipruit: Sounds a bit complicated. So, the first line is a simple difference between two MAs that we’ve specified in the parameters of the MACD indicator. Speaking in terms of default settings – this is “26-period MA – 12-period MA”. So, software calculates the value for 12-period MA, then it calculates value for 26-period MA and finally calculates the difference between them and particular this difference we see as the first line of MACD Indicator right?
Commander in Pips: Absolutely.

Chart #1 60-min EUR/USD and MACD (12; 26; 9)
This is “26-period MA – 12-period MA - Forex School
Pipruit: Well, then. The second line is calculated by software using the same formula of Moving Average calculation. But instead of using close prices as it was in previous part 11 of book, it uses values of (MA1-MA2) during the number of periods that we’ve specified. So, using the same default settings, this line plots average value of (MA1-M2) for 9 periods. So, this is the second line, a?
Commander in Pips: That’s right.

Pipruit: Cool. Looks like, I’ve got it!
Commander in Pips: And now is my turn to ask questions. Why in the first line we should calculate MA1-MA2, and not MA2-MA1?

Pipruit: May be I’m wrong, but it reminds me the simple strategy of two MAs crossing, that we’ve already discussed. When fast line (with shorter period) crosses slow line (with longer period) from below and comes above – the trend turns bullish and vice versa. Since MA1 is faster than MA2 –it reacts faster on trend shifting. That’s why we use MA1-MA2, and not opposite.
Commander in Pips: You’re absolutely right.

Pipruit: Commander and what is a “Signal Line”?
Commander in Pips: Oh, yes – some software names third MA, that is MACDA and that has 9 periods as default, as Signal Line. This is slower line, and signal of trend shifting will appear when first line penetrates it. That’s why it calls like that. So:

1. Fast line of MACD (usually colored with blue) – MA1-MA2 that you appoint in indicator tweak menu;

2. Slow line of MACD, aka Signal Line (usually colored with red) – MA on (MA1-MA2).

Now is about plotting MACD as a Histogram. Histogram shows the distance between MACD lines – that’s all. So, when the lines come close to each other, i.e. converge – the histogram gets smaller and it’s bars are shorter. That’s correct, because the distance between the lines becomes smaller. And it is called convergence of moving averages.

The opposite is also true – when the distance between lines becomes wider, i.e. lines diverge from each other – the histogram gets bigger, and it is called divergence of moving averages.

Here is the name – Moving Averages Convergence Divergence!

Application of MACD


Trend identification

As we’ve said, MACD has two MAs with different speed. As we already know the fast MA (with smaller period) will faster react on appearing of new trend and outstrip the slower MA in following to trend. Hence – fast MA will cross slower MA. Actually, the way of interpreting MACD is the same as simple MA crossing.

When such crossover has happened and the fast MA starts to diverge from the slower one, it indicates that a new trend has appeared:

Chart #2 60-min EUR/USD and MACD (12; 26; 9)
MACD has two MAs with different speed - Forex School
On chart #2 you can see, that line crossing nicely point on starting bull trend, and on bear trend then. So, the crossing of the fast line (blue) of the slow line (red) from below and moving above – indicates that the trend has shifted to bullish. If the fast line crosses the slow line from above and moving below –the trend turns bearish.

Also take a note, that when the lines cross – the histogram disappears. This happens, because the difference between the lines equal to zero at the moment of crossing – hence the value of the histogram is also zero. But after that, when the distance between lines starts to increase – the histogram becomes greater and this is a good indication of a solid trend.

But, as with any tool MACD has its own bugs. I intentionally draw the rectangle on the chart. Does it remind you anything? Pay attention to signals that MACD generates during this rectangle and match them with price action…

Pipruit: Well-well, looks like we have here whipsaw price action, do we? I can’t guarantee the financial result of trading here, but the fact that MACD is too slow in estimating fast and short-term trend shifts is obvious.​

Commander in Pips: You’re rights. Since MACD has much common with simple moving averages – it has the common disadvantages with them as well. That’s why it tends to lag behind the price…

Pipruit: I do imagine – MACD is not just a simple MA – this is a Moving Average of a Moving Average… So, there is no surprise that it has a lag…​

Commander in Pips: But still, it is one of the most favored tools amongst the traders, including me. Personally I use only MACD for trend identification, but in a bit of an advanced manner. For now we will talk how to reduce the negative impact of MACD lagging to trend identification.

Fine Tuning of MACD and some advanced talks

1. The type of MAs that are used in MACD indicator do make sense! 

You have to know that MACD could be different in different software programs. As many software programs as many different combinations of MA types they use in MACD Indicator. Usually MA1 and MA2 are Exponential and the Signal line is simple MA. Personally I prefer to use the exponential way of averaging for all lines in MACD Indicator;

2. As with any other indicator MACD demands a responsible approach to using it. You should investigate what type of MAs averaging in MACD and what parameters of them are most suitable personally for you. Also you can apply different parameters to different pairs and time frames. Maybe it will make sense.

3. Usually trend shifting is treated as confirmed when the market confirms it by close price. It is important, because if you’ve entered long in the beginning of the current trading session and an unconfirmed trend was, say, bullish but when trading session has closed and the confirmed trend becomes bearish – so you will be on the wrong side of price action.

4. The angle of line crossing does make big sense. The greater the angle – the stronger the signal of trend shifting:

The greater the angle – the stronger the signal of trend shifting - Forex School
This is not necessary means that a weaker signal will lead to loss or choppy price action. Sometimes even a weaker signal could lead to a tremendous trend. But from a confidence and probability point of view – the greater the angle of crossing, the better.

5. MACD works much better if the market is in a thrusting move. If for instance, if the market has shown a nice thrust up (at least 8-12 bars), and then has turned to retracement down – then a MACD signal about continuation of the previous up move has more chances for success because it is supported by market momentum. When the market choppy and sloppy, without any signs of thrust – better not to trade here with MACD or any other trend indicators.

This is not necessary means that a weaker signal will lead to loss or choppy price action. Sometimes even a weaker signal could lead to a tremendous trend. But from a confidence and probability point of view – the greater the angle of crossing, the better.

Comments

A
AsstModerator
12 years ago,
Registered user
VERY IMPORTANT NOTE: The MACD indicator that comes with MT4 has only 1 line and a histogram. It doesn't match the version that Sive describes. Here is a better version that was posted elsewhere:

https://www.forexpeacearmy.com/community/attachments/macd-true-mq4.3507/

You will need to be logged into your FPA Forums account to download the attachment.
L
Liquid
12 years ago,
Registered user
MACD true

Thanks for this indicator! I had trouble finding a good MACD with 2 lines.
G
georgeta
12 years ago,
Registered user
MACD

Thank you for the MACD true!
Is there possible that someone programs a MACD with exponential MA that can be custom? ... you know what I mean ;)
S
Sive Morten
12 years ago,
Registered user
> Thank you for the MACD true!
Is there possible that someone programs a MACD with exponential MA that can be custom? ... you know what I mean ;)

Hi Georgeta,
I think this is possible. The proper exp MACD could be easily programmed for MT4. All that you have to do is to enter in the code and change the type of averaging for signal line.
H
hamsarath
12 years ago,
Registered user
MACD true

Thank you very much.

Best regards
Sarath
I
Irfan Shaikh
12 years ago,
Registered user
Improved MACD

Hi Sive,

I just wanted to know how can I use this improved MACD? I am using the pre installed MACD in my MT4 platform...Can I get this or some other improved version of the MACD plz? Where can I get it from...? Where and how to install it...? Plz reply me...

Thank you so much.

Irfan
S
Sive Morten
12 years ago,
Registered user
> Hi Sive,

I just wanted to know how can I use this improved MACD? I am using the pre installed MACD in my MT4 platform...Can I get this or some other improved version of the MACD plz? Where can I ge..

Hi Irfan,
to get DiNapoli MACD from those that default for MT4 you need to change averaging type for signal line to exponential and add possibility to use fraction periods. That's all.
But this is a bit personal, I mean MACD parameters and type of averaging. You should use those that is acceptable personally for you.
I
Icarus
12 years ago,
Registered user
> VERY IMPORTANT NOTE: The MACD indicator that comes with MT4 has only 1 line and a histogram. It doesn't match the version that Sive describes. Attached is a better version that was posted elsewhere..

Thank you! This is very helpful!
F
fazli
12 years ago,
Registered user
thank you

hi sive,.....thanks for the effort.

i installed the MACD true in my mt4 trading platform, the histogtam is all in green, is it suppose to be like that or i need to do something about it.

we only need to focus on the crossing right, when the blue line cross the red line = buy and vice versa. pls correct me if im wrong.

thanks again:)
S
Sive Morten
12 years ago,
Registered user
> hi sive,.....thanks for the effort.

i installed the MACD true in my mt4 trading platform, the histogtam is all in green, is it suppose to be like that or i need to do something about it.

we onl..

Hi Fazli,
in general - you're right :)
But MACD shows a lot of additional information - angle of crossing, market strength are also important. Also it shows such signals as Dynamic pressure and Stop grabber paterns...
If you was not in time to read sneak preview - wait a bit, this chapter will release soon again
F
fazli
12 years ago,
Registered user
> Hi Fazli,
in general - you're right :)
But MACD shows a lot of additional information - angle of crossing, market strength are also important. Also it shows such signals as Dynamic pressure and Sto..

thanks sive, i will wait for the next sneak preview and i'll make sure i catch this one. btw, have a nice vacation.
G
Gustaf78327
12 years ago,
Registered user
Thanx again!

Thank you for the information Mr. Sive and for the indicator Asst. Moderator.!!

Hoping everyone much prosperity in life as well as trading.

Peace!!
R
Rachael A
12 years ago,
Registered user
Thanks for our school of learning and thanks for the MACD True, it's all very much appreciated, Thanks, RA
E
EMEH MATTHEW
12 years ago,
Registered user
good MACD with 2 lines.

> Thanks for this indicator! I had trouble finding a good MACD with 2 lines.

pls send me one
S
stelore
12 years ago,
Registered user
> pls send me one
Hi Emeh,
you can find and download it in the first page,
AsstModerator posted it (Thanks for it...)

Bye
Stefano
B
blueraven316
11 years ago,
Registered user
Hi,
I would like to have the In Chart MACD indicator which helps me to watch bullish/bearish stop grabbers like in your daily videos, If you cannot post it here can you let me know where to find it and what to search for on the internet,

Thanks in advance
S
Sive Morten
11 years ago,
Registered user
> Hi,
I would like to have the In Chart MACD indicator which helps me to watch bullish/bearish stop grabbers like in your daily videos, If you cannot post it here can you let me know where to find it a..

Hi Blueraven,
its distribution is forbidden by copyright law. You can use software (that is not free) that has it - for example CQG or Genesis Trade Navigator, or program it by yourself, as I did.
J
Joh
11 years ago,
Registered user
> VERY IMPORTANT NOTE: The MACD indicator that comes with MT4 has only 1 line and a histogram. It doesn't match the version that Sive describes. Attached is a better version that was posted elsewhere..

Thank you very much for this version -i finally got it and 'get it' -most appreciated - am excited, hope to put it to good use :)
B
blueraven316
11 years ago,
Registered user
> Hi Blueraven,
its distribution is forbidden by copyright law. You can use software (that is not free) that has it - for example CQG or Genesis Trade Navigator, or program it by yourself, as I did.

Thanks for the reply Sive,

I heard of this one user called Kamuta who makes EAs and programs indicators, maybe I will check with him if he can help me out.
M
Marky$
11 years ago,
Registered user
> Hi Irfan,
to get DiNapoli MACD from those that default for MT4 you need to change averaging type for signal line to exponential and add possibility to use fraction periods. That's all.
But this is ..

Hi Sive,

I wonder how to use fraction periods for MA.
I've dissected code of MACD built into MT4 and found out that there is no possibility to apply fraction periods. From mathematical point of view, how to take for example 8.32893 part of period bar? There is only one close price per bar and it is at the end of period. How to get close price for 0.32893 part of the bar?
Should I calculate MA for 8 periods and multiply by some factor? But what value of the factor should be?
Or maybe should I take for 1H time frame lower time frame data for calculation the MA?
For example: For 1H time frame MA(7). Take data from 1min timeframe, so calculate MA(7*60). So I can calculate for example 1H MA(7.5) what equals MA(450) on 1min. chart. But I'm still limited to fractions divided by 60.
What do you think about that idea?
S
Sive Morten
11 years ago,
Registered user
> Hi Sive,

I wonder how to use fraction periods for MA.
I've dissected code of MACD built into MT4 and found out that there is no possibility to apply fraction periods. From mathematical point of view,..

Marky,
DiNapoli MACD has a difference from common MACD. It uses exponential averaging method while common MACD - simple averaging. Since there is absolutely different methodology in exponential averaging (particular speaking using smoothing factor as 2/((n(i)+1), where n(i) is a number of periods.
EMA = EMA(t-1)+SF*(Close – EMA(t-1))
From that perspective fractional number of periods has a sense.
M
Marky$
11 years ago,
Registered user
Hi Sive,

Thank you for your response and explanation.
In meantime I tweaked a bit MACD offered by moderator in this topic (I hope the author doesn't mind it.). Because you have to use integer value for periods in MT4, as I said earlier, I used data from 1M time frame for all Time Frames. So I can put fraction MA on all time frames higher than 1M. But it doesn't look good. It shifts indicator forward. I suppose that it does it because of last bar. I came to the conclusion that I can't use 60 1M bars for last bar at 1H time frame till hour is finished. I have to use appropriate amount of minutes of last bar. But it needs a little bit more of maths in the code. Maybe I'll code it later when I'll have more time to do it.
H
Hamza Samiullah
6 years ago,
Registered user
Nice lesson
O
One-fm
5 years ago,
Registered user
Thanks for the Macd true.

Table of Contents