MACD (Moving Average Convergence-Divergence) How to Use MACD in Forex Trading

MACD is one of the most reliable indicators. Although we do not believe in using any indicators in our own trading and we always use the candlesticks charting and Bollinger Bands to find the trade setups, still we believe that MACD is a strong indicator specially for novice traders who are used to get in and out of the market too early.

MACD is a lagging indicator and its delay makes you be patient, not to rush to enter the market or get out of it too early. Recently we published another article about MACD to show our followers how they can use slower settings of MACD to have a better entry, and hold the positions longer to maximize the profit: How To Use Slower Settings Of MACD Indicator?

There are so many professional traders (both stock and forex traders) who rely on this indicator. Of course, we should not exaggerate about this indicator. It is not a magic tool to show you the buy/sell signals. However, compared to the other indicators, it is great. It can be used along with RSI to confirm the trade setups.

Why MACD Works?

That is a million dollar question. Before we tell you why MACD works, we prefer to explain about one of the most important reasons of forex traders’ (and also all other kinds of traders’) failure. Maybe you have heard this a lot from us, but it has to be reminded in this article too. Lack of patience is one of the most important reasons of forex traders’ failure. Most traders are not patient enough to wait for a strong trade setup. After several minutes, hours or days that they wait for a trade setup (depend on the time frame or system they use), and they cannot locate any, they lose their patience and force themselves to take a position while there is no sharp and clear trade setup. So they lose.

On the other hand, when they succeed to take a good position, they get out too early with a small profit, because they are afraid of losing the profit they have already made. They do not have enough patience to hold a position until it hits the target. So they make their profit limited, because of lack of patience.

MACD is a solution for these problems, because it is delayed and this delay forces you to wait more, both when you are waiting for a trade setup, and when you are holding a position. That’s why MACD is recommended both by forex and stock traders.

(Note: Heikin Ashi is one of the other tools that helps you wait more both before the trade setup and while you are in the market. You can read about Heikin Ashi here.)

Sometimes your other indicators and even the price chart show you a trader setup, but MACD tells you to wait, and it keeps you from going against the trend and losing money. There are also a lot of cases that you want to follow a trend, but MACD tells you that it is too late and the trend is exhausted and may reverse at any time. In this article, we will do our best to cover all of these cases and help you use MACD in your trades in the best possible way.

What Is MACD Definition?

MACD stands for Moving Average Convergence Divergence. MACD is an indicator used in technical analysis. This indicator is developed by Gerald Appel who was a trader and market technical analyst.

MACD is the difference of a 12 and a 26 exponential moving average. MACD subtracts the 26-period from the 12-period and the result will be displayed in a single line which is the MACD main line. Typical MACD indicators, have one extra line, which is an exponential moving average of the main line. This moving average is set to 9 by default and it is called signal line. In MetaTrader, the default MACD doesn’t have the main MACD line. Instead, it has bars (histogram). On other platforms, you can see both the MACD main line and MACD histogram.

MACD histogram is the difference of MACD main line and the 9 exponential moving average:

MACD Histogram: MACD Main Line – Signal Line

As you see, MACD is nothing but the combination of two moving averages. In spite of this, it is a very strong and reliable indicator because it eliminates the market noise.

MACD Formula:

If you are a trader, probably MACD formula will have no use for you. You will need it, if you are a programmer and want to use MACD in designing and developing an EA (expert advisor) or robot. However, the formula helps you understand the indicator better. We already talked about this indicator’s calculation:

Main Line: 12 EMA – 26 EMA
Signal Line: 9 EMA of Main Line
Histogram: Main Line – Signal Line

Download The Coloured MACD:

The MACD that comes with MetaTrader by default, has only one color with the histogram. If you like to have the same colored MACD we have on our charts (below screenshots), please download and install it to your platform before we start explaining about MACD and the way we use it in technical analysis and forex trading. This indicator works in MetaTrader. You need to copy and paste it to the /experts/indicators/ folder and then restart your platform and apply the indicator on the price chart. Click Here to download the coloured MACD.

To install the Coloured MACD on your MT4 platform, you have to copy the indicator to the “Indicators” folder.

To do that:

  1. Click on “File” menu at the top left of your MT4 platform.
  2. Click on “Open Data Folder”.
  3. Open the “MQL4” folder.
  4. Open the “Indicators” folder.
  5. Copy and paste the indicator to “Indicators” folder.
  6. Restart the MT4 platform.
  7. Open a price chart.
  8. Press Ctrl+N to open the navigator. Open the “Indicators” dropdown.
  9. Drag “FxKeys-MACD.ex4” and drop it on the chart.

How Does MACD Look Like On The Price Chart?

The below chart shows how coloured MACD looks like. It also has the Moving Average 9 but we always set it to zero, because we don’t use it. It doesn’t help. In the indicator you downloaded above, it is set to zero by default, but you can change it back to 9 if you like.

The MACD bars (histogram) you see below, reflect the difference of the main and signal lines. On the price chart, you see the main and signal lines. The red one is the main line and the green line is the signal line. As you see, wherever the distance of these two moving lines is bigger, the MACD bars will become  longer too, and wherever these two lines cross, the length of the related MACD bar is zero (follow the black arrows).

As you see, when there is an upward movement and pressure (the market is bullish), MACD histograms go up and change the color to blue and when there is a downward pressure and movement (the market is bearish), they go down and change the color to red.

MACD bars form highs and lows. When we have an uptrend, they form higher lows and when we have a downtrend, they form lower highs and when the bars go under the zero level, they form lower lows:


How Does MACD Save You From Going Against The Trend?

As we mentioned, MACD is delayed and so when you see a reversal signal with the candlesticks and Bollinger Bands and you want to take a position against the trend, MACD tells you “No”. Of course, if you know about the Elliott Waves and also the cycles, you will not take any positions against the trend, even if you don’t have MACD on your chart, but as knowing the cycles and Elliott Waves is very difficult, you can use MACD to stay on the right track.

Please look at the below reversal signal. A candlestick is formed completely out of the Bollinger Bands and then there are three Bearish candlesticks that are all reversal signals. Three candlesticks before this, you already had another reversal signal, but you should have ignored it, because it was fresh and it came just after a big Bullish candlestick. But, the second sell signal (the yellow zone), assures that you can go short. Let’s say you wouldn’t have MACD on your chart, or you had it, but you wouldn’t pay any attention to it. You could go short and set your stop loss above the highest high.

And guess what? Your stop loss would be triggered:

So going against MACD is dangerous. Of course, the above signal formed by the candlesticks are not strong enough. That is why the price did not reverse and kept on going up. As novice traders are unable to distinguish the strong candlestick trade setups, having MACD can be a big help not to go against the trend based on the weak trade setups.

Going against the trend based on the weak candlestick signals is not the only mistake you can make. MACD also indicates whether the market is overbought or oversold. When it is overbought, it is riskier to go long and when it is oversold, it is riskier to go short. When market is overbought, Bulls (buyers) can start collecting their profit (they sell) at any time, and so the price may go down, and when market is oversold, Bears can start buying at any time, and so the price may go up. Of course, the candles also tell you if market is overbought or oversold, but MACD is also a big help. Lets take a look at an example:

You are a trend trader. You have an uptrend here (below). You see some reversal signals, but you wait for a continuation signal to go long. A strong Bullish candlestick forms (the last one on the below chart) and at the same time the last MACD bar changes its color and shows an upward pressure. This is what you have been waiting for to go long, but you don’t consider that the market has been going up for a long time (overbought) and can reverse at any time. Of course it can go much higher, but we never know:

This position goes up only for one more candlestick and then goes down and triggers your stop loss:

MACD Buy-Sell Signals

MACD trading is so common among forex traders. They just wait for a fresh MACD movement for a few bars and then they enter. MACD is really good for trend trading. It is also good for confirming the reversal signals. However, MACD has to be used as a confirmation. The main indicator is the price. If you use MACD as a confirmation for support and resistance breakout, it will be a big help. Those who trade based on the support/resistance breakout have to have MACD on their charts, otherwise their success rate will not be reasonable.

Look at the below image. There is a trend line with valid and visible support line. You are waiting for the support breakout to go short. MACD starts going down for several candlesticks before the breakout, but you don’t go short because it can bounce up as soon as it touches the support line. One of the candlesticks closes below the support line and at the same time you see that MACD is going down, BUT it is fresh and it is not oversold. It is above the zero level too. So you go short at the open of the next candlestick, set your stop loss above the high price of last candlestick and your target will be the next support level. It goes down and hits the target very easily.

Now look at the below image which is the same as the above image, but it just shows another support breakout which happened a while after the above support breakout. Obviously, it is a new chance to take another short position, but look at the MACD and its difference with the previous position. In the previous position, MACD had started going down while it was way above the zero level. It means, you would go short while market has been overbought which is a good decision. In this position (below), not only MACD is not above the zero level, but it has already started going up and making higher lows. So the market is oversold and your sell signal is not fresh. It is a second hand sell signal :)

And guess what would happen if you went short and you didn’t consider MACD:

Yes, your position triggers the stop loss before it hits the target.

MACD Divergence

MACD Divergence is one of the most famous and the strongest trading signals that MACD generates. MACD Divergence forms when the price goes up and makes higher highs and at the same time, MACD bars go down and make lower highs. The rule says, the price will finally follow the MACD direction and will go down. However, the problem is you never know when the price will follow the MACD direction. So, if you rush and take a short position right when you see the MACD Divergence, it may keep on going up for several more candlesticks. You should go short when MACD Divergence is followed by a good sell signal by the candlesticks and/or a support breakout.

MACD Divergence can be seen at the end of uptrends. What does it mean? It means if you are a trend trader, you should not go long when you see that MACD Divergence is formed. It can collapse at any time.

MACD Convergence:

MACD Convergence is also a famous signal, but people trust the MACD Divergence more because when the market collapses and goes down, it goes faster and stronger. Fear is stronger than greed and when markets go down, fear is the dominant emotion.

MACD Convergence forms when price goes down and forms lower highs or lower lows, but at the same time MACD bars go up and form higher highs or higher lows. The rule says, the price will finally change the direction and will follow MACD which means it will go up. MACD Convergence can be seen at the end of downtrends. What does it mean? It means if you are a trend trader, you should not go short when you see that MACD Convergence is formed. It can bounce up at any time.

Good luck :)

Download Our E-book For FREE and Don't Miss Our New Articles!
Enter your email address and check your inbox now:

Article by

"Whether you think you can, or you think you cannot, you are right." - Henry Ford

  1. Kirill February 8, 2014 at 6:17 pm

    Hi! many thanks for sharing your thoughts!
    I have been in the markets for over 12 years, but still your detailed approach helps a lot in fine tuning my strategy
    from my experience macd is one of the best indicators. I came to an idea to study macd after a trader i knew from a big bank few years ago was making millions dollars a year using Elliott waves with macd. however i believe macd itself is useful as studying EW theory for over 3 years i came to the conclusion that Elliott waves are just too ambiguous…

    Have 2 questions:

    1) what are other best indicatiors to use with macd (you personal preference)

    2) being a trend trader (i presume you are) what are your thoughts on building up/adding positions i.e like Bill Williams teaches on fractals breakthrough or on rebounds/dips?

    happy to keep in touch! again thanks for your web resource!


  2. Joshua July 2, 2014 at 7:46 am

    Thanks Dr Chris the concept is broadly explained. I have a question how possible is it to use the crossing of the main and signal line in determining the trend movement. Does it have any effect? I notice the predominant upward presense of the Red line which is the main line in an upward trend?

    • Chris Pottorff July 2, 2014 at 1:54 pm

      Yes. MACD is a slow and lagging indicator and so it is good for following the trends. Additionally the crossing of the main and signal line usually reflects the trend exhaustion and reversal.

  3. Martin August 3, 2014 at 12:59 am

    Good day, thank you very much for explained the concept but why I can’t open the coloured MACD indicator?


    • Chris Pottorff August 3, 2014 at 6:44 am

      You don’t have to open it. You have to copy and paste it to MT4 indicators folder.

      • BK8 February 22, 2015 at 12:20 pm

        Just to add, if you are using MT4… following teps can help you

        1.File – > Open Data folder
        2. MQL4 – > Indicators
        3. Copy FxKeys-MACD.ex4
        4. close your MT4 and reopen
        5.Open Your chart and click on add indicator.. should 3rd from right on top
        6. Select Custom – > Fxkeys- MACD
        7. As author, you may use with HikenAshi chart

  4. Bassaveli August 15, 2014 at 3:55 am

    thank you very much for your detailed articles. it helped me a lot and i’m a new trader, I have 1 question.

    1) when i Add the MACD to the chart it asks me to select the ema time frame which isby default slow 26 fst 12. I add it but it doesnt give histogram graph just like the one you put in this article, it rather displays a line down below in the graph, especially that i’m using another platfom and not MTD4, what i’m doing wrong? on my graph I have the BB’s and the candlesticks.

  5. kamrul September 10, 2014 at 6:59 am

    i need to know how to set up MACD signal line. i am using MACD given by meta trader but there is only MACD line, signal line is absent here. how can i set up signal line…

    • Chris Pottorff September 10, 2014 at 8:49 am

      MT4 doesn’t have the MACD you want. You have to download the “traditional MACD” and install it on your MT4 platform.

  6. Asiri October 13, 2014 at 11:58 am

    hi.Chris…. good explanation…. Although MACD is lagging.. we can use it to assure about right time to enter and stay away…

    Can we set main line and signal line manually ??
    I mean without MACD only use the EMA??
    Please Chris tell me values..

    Main Line: ……..
    Signal Line: ………….

    good luck..

  7. Asiri October 13, 2014 at 11:40 pm

    thanks Chis for reply.

  8. ishmeet November 13, 2014 at 9:38 pm

    I have read that for Peak-Trough Divergence” MACD forges a lower low and the MACD-Histogram forges a higher low” how can identify that higher and lower low in the graph

  9. Ali Raza December 12, 2014 at 2:42 am

    There is a term used in this article ‘fresh MACD movement’. Please explain what is ment by it?

  10. Peter Wagner December 24, 2014 at 6:49 am

    Hi Chris

    In the above article, just under the first image, it is written: “MACD bars form highs and lows. When we have an uptrend, they form … higher lows… and when we have a downtrend, they form … lower highs … and when the bars go under the zero level, they form lower lows”. While this seems correct, the images that follow seem to indicate that the ‘.. higher lows..’ should be ‘higher highs’ and the ‘..lower highs ..’ should be ‘lower lows’? A bit unclear here.

    • Chris Pottorff December 24, 2014 at 1:52 pm

      Hi Peter,

      You are right. But that is also correct. It is like the uptrend definition which is when price forms higher lows. And downtrend is when price forms lower highs.

      But you are right. That doesn’t look good for MACD.

  11. eze January 21, 2015 at 4:52 pm

    I do trade auto demarktrend breakout, how can one trade breakout with low low or high high histogram after crossin zero. during break out

  12. Jerry March 5, 2015 at 12:42 am

    Hello Chris,

    First of all, thanks for this awesome website and your excellent mentoring!

    I have downloaded the coloured MACD indicator linked with this article. However, I am unable to have it displayed on my MT4 platform.

    Is this link still working?



    • Chris Pottorff March 5, 2015 at 2:38 am

      Hi Jerry,

      Thank you too and welcome to FxKeys.

      I tried the link. It works. I downloaded the indicator and installed it on my platform and it works without any problems.

      Do you know how to install it on your MT4 platform?

      I just added the installation instruction to the above article. Please scroll up and find it below the download link.

      Please let me know if you still have any problems.

  13. Rajiv March 21, 2015 at 4:27 am

    Hi Chris,

    Very nicely explained. Thanks

  14. Manoj April 9, 2015 at 8:28 am


    information is AWesome

    can u please post the trading recommendations

  15. Ajax Janus May 11, 2015 at 3:59 am

    Hello Chris,

    there is something that puzzles me and I would like to short it out.
    Looking at the last image below the MACD histogram the second arrow reads lower low while I reckon it should read higher low. Am I right in thinking so? Thanks in advance

  16. titanium June 5, 2015 at 4:29 pm

    Hey, Chris, I don’t get how to recognize higher lows. I mean, are they the ones closer to the upper level?

  17. titanium June 5, 2015 at 5:14 pm

    Chris, I followed all you instructions. I downloaded the indicator, then I copied it on the indicators folder, but when I press control plus N, I just can see the metatrader MACD, fxkeys MACD doensn’t appear on the indicators list, even if it is inside the indicator folder. What did I do wrong?

    • Chris Pottorff June 6, 2015 at 10:08 am

      The only reason that you cannot see it there is that the file is not installed on the right folder.

  18. titanium June 6, 2015 at 11:59 am

    I copied it on the indicator folders. Isn’t it right?

  19. titanium June 6, 2015 at 5:40 pm

    I closed the platform and then I opened it again, but the indicator didn’t appear.

    • Chris Pottorff June 7, 2015 at 12:12 am

      Did you refer to the “Open Data Folder” on the file menu at the top and then paste the indicator file in C:\Users\…\MQL4\Indicators folder?

  20. titanium June 7, 2015 at 10:41 am

    I did it. Thank you very much for you help.

  21. titanium June 7, 2015 at 10:47 am

    Hi Chris, the setting of the coloured MACD is 12,26, 2. I wanted to use the slower setting you advised us , which is 24,52,9. How can I change that?

  22. titanium June 7, 2015 at 2:40 pm

    Thank you very much.

  23. ravin tharinda June 18, 2015 at 2:52 am

    Hi Chris,
    Once I added the indicator to my Chart in MT4 only I can see Histograms. Can cannot see Slow EMA & fast EMA. How can I fine-tune it to be visible.

  24. Ivan Todorov September 4, 2015 at 5:42 am

    Simple and clear explanation. Great work,thank you!

  25. Arpad Huszty October 24, 2015 at 2:38 am

    Hi Chris

    I want to make an EA robot with my frend . Please send me ( if possible )the code of the color MACD ( with red and green line)

    Best regards
    Arpad Huszty

    • Chris Pottorff October 28, 2015 at 7:58 am


      Here it is:

      #property copyright “Copyright ©
      #property link “”

      #property indicator_separate_window
      #property indicator_buffers 5
      #property indicator_color1 Green
      #property indicator_color2 Red
      #property indicator_color3 Gray
      #property indicator_color4 LimeGreen
      #property indicator_color5 DarkSlateBlue
      extern int FastEMA=12;
      extern int SlowEMA=26;
      extern int SignalSMA=0;
      extern int CountBars=1000;
      extern int Line=2;
      extern double Zero_level=0.0;
      double ind_buffer1[];
      double ind_buffer2[];
      double ind_buffer3[];
      double ind_buffer4[];
      double ind_buffer5[];
      double ind_buffer6[];

      double minuse;
      double Vol;
      double Zml;
      double Color1;
      int init()

      ObjectCreate(“Copyright”, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(“Copyright”, “Learn more about trading:“, 8, “Arial”, Red);
      ObjectSet(“Copyright”, OBJPROP_CORNER, 2);
      ObjectSet(“Copyright”, OBJPROP_XDISTANCE, 5);
      ObjectSet(“Copyright”, OBJPROP_YDISTANCE, 8);

      if(!SetIndexBuffer(0,ind_buffer1) &&
      !SetIndexBuffer(1,ind_buffer2) &&
      !SetIndexBuffer(2,ind_buffer3) &&
      !SetIndexBuffer(3,ind_buffer4) &&
      !SetIndexBuffer(4,ind_buffer5) &&
      Print(“cannot set indicator buffers!”);
      Color1= C’128,0,255′;
      SetIndexStyle(0,DRAW_HISTOGRAM, STYLE_SOLID, Line, Color1);
      SetIndexStyle(1,DRAW_HISTOGRAM, STYLE_SOLID, Line);
      SetIndexStyle(2,DRAW_HISTOGRAM, STYLE_SOLID, Line);
      SetIndexStyle(3,DRAW_LINE, STYLE_SOLID,2);
      SetIndexStyle(4,DRAW_LINE, STYLE_SOLID,1);



      int start()

      SetIndexStyle(0,DRAW_HISTOGRAM, STYLE_SOLID,Line);
      SetIndexStyle(1,DRAW_HISTOGRAM, STYLE_SOLID,Line);
      SetIndexStyle(2,DRAW_HISTOGRAM, STYLE_SOLID,Line);
      SetIndexStyle(3,DRAW_LINE, STYLE_SOLID,1);
      SetIndexStyle(4,DRAW_LINE, STYLE_SOLID,1);

      int limit;
      int counted_bars=IndicatorCounted();
      if(counted_bars<0) return(-1);
      if(counted_bars>0) counted_bars–;

      for(int i=0; i 0.0){ind_buffer1[i]=Vol; ind_buffer2[i]=0.0; ind_buffer3[i]=0.0;}
      else {if(minuse<0.0){ind_buffer1[i]=0.0; ind_buffer2[i]=Vol; ind_buffer3[i]=0.0;}
      else {ind_buffer1[i]=0.0; ind_buffer2[i]=0.0; ind_buffer3[i]=Vol;}}

      for(i=0; i (0)

Leave a comment:

You must be logged in to post a comment.