Moving Average Convergence/Divergence (MACD)
Developed by Gerald Appel, Moving Average Convergence/Divergence (MACD) is one of the simplest and most reliable indicators available. MACD uses moving averages, which are lagging indicators, to include some trend-following characteristics.
These lagging indicators are turned into a momentum oscillator by subtracting the longer moving average from the shorter moving average. The resulting plot forms a line that oscillates above and below zero, without any upper or lower limits.
The most popular formula for the MACD is the difference between a security's 26-day and 12-day Exponential Moving Averages(EMAs).
Of the two moving averages that make up MACD, the 12-day EMA is the faster and the 26-day EMA is the slower. Closing prices are used to form the moving averages. Usually, a 9-day EMA of MACD is plotted along side to act as a trigger line. A bullish crossover occurs when MACD moves above its 9-day EMA, and a bearish crossover occurs when MACD moves below its 9-day EMA.
The histogram is positive when MACD is above its 9-day EMA and negative when MACD is below its 9-day EMA.
MACD is a trend following indicator, and is designed to identify trend changes. It's generally not recommended for use in ranging market conditions. Three types of trading signals are generated,
* MACD line crossing the signal line.
* MACD line crossing zero
* Divergence between price and MACD levels
The signal line crossing is the usual trading rule. This is to buy when the MACD crosses up through the signal line, or sell when it crosses down through the signal line.
When the MACD line crosses through zero on the histogram it is said that the MACD line has crossed the signal line.
The histogram can also help visualizing when the two lines are coming together.
A crossing of the MACD line up through zero is interpreted as bullish, or down through zero as bearish.
Positive divergence between MACD and price arises when price makes a new selloff low, but the MACD doesn't make a new low(i.e. it remains above where it fell to on that previous price low). This is bullish, suggesting the downtrend may be nearly over.
Negative divergence is when price makes a new rally high, but MACD doesn't rise as high as before, this is bearish.
First check whether price is trending. If MACD is flat or stays close to the zero line, the market is ranging and signals are unreliable.
Go long when the MACD line crosses the signal line from below.
Go short when the MACD line crosses the signal line from above.
Signals are far stronger if there is either:
a divergence on the MACD line; or
a large swing above or below the zero line.
To Calculate MACD in MS Excel:.
Column | Description | Formula to enter
A = Company Name/date
B = Open
C = High
D = Low
E = LTP/close
F = Volumes
G (12DAY EMA) = first we have to calculate 12-Day Ema:
For 12 day Ema,we have to calculate 11-day Simple mov.aver(SMA).
Formula= Sum(E2:E12)/11 , enter formula in G12
In 13 row of G column we have to calculate ema
EMA formula = price today * k + EMA yesterday's * (1-k) where N is number of days in your ema
X(EMA) = (K x (C - P)) + P
X = Current EMA,
C = Current Price,
P = Previous period's EMA*,
K = Smoothing constant
(*A SMA is used for first period's calculation),K = 2/(1+N),N = Number of periods for EMA
K = 2/(1+N)
so formula for 12day ema would be =E13*0.15+G12*(1-0.15) OR (0.15*(E13-G12))+G12, enter formula in G13, copy the formula till latest closing price.
H (26DAY EMA) = now we have to calculate 26 day ema,so u have to go thru the Mov.Aver.formula steps once again:
we have to calculate 25-day Simple mov.aver(SMA).Formula= =Sum(E2:E26)/25 enter formula in H26
so formula for 26day ema would be =E27*0.074+H26*(1-0.074) OR (0.074*(E27-H27))+H27,enter formula in H27,copy the formula till latest closing price.
I (MACD[FAST LINE])= Subtract 26-day ema from 12-day ema.so formula =H27-G27, enter in I27,copy the formula till latest closing price.
J (9-day ema[Slow Line]) = first we have to calculate 9-Day Ema of MACD(trigger/signal line)
calculate 8-day Simple mov.aver(SMA).Formula =SUM(I27:I34)/8,enter the formula in J34
then,Ema kicks in
K = 2/(1+N), so 2/(9+1)=0.2
=I35*0.2+J34*(1-0.2),enter the formula in J35,copy the formula till latest closing price.
K (MACD Histogram)= we have subtract Slow line(J34)from Fast line(I34) so formula =J34-I34,enter in K34,copy the formula till latest closing price.