Sunday, July 22, 2007

Moving Average Convergence/Divergence (MACD)

Moving Average Convergence/Divergence (MACD)

Introduction
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.

MACD Formula
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.

Interpretation
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.

Trading Signals
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 Moving Average CD of Nifty or Individual stock in MS Excel:.

Column, values to enter, formulas you have 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 calulate ema

EMA formula = price today * k + EMA yesterday's * (1-k) where N is number of days in your ema

OR 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

calculation
K = 2/(1+N)
12day=2/(12+1)=0.15
26day=2/(26+1)=0.074

so formula for 12day ema would be =E13*0.15+G12*(1-0.15) OR (0.15*(E12-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.for. steps once again
we have to calculate 25-day Simple mov.aver(SMA).Formula= =Sum(E2:E26)/25 enter formula in G26

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 closingprice.

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.






Kindly recommend my blog to your friends,if it is useful to u,by telling them and giving backlink in your blog.thanks in advance.
Post a Comment

Popular Posts for last 7 days

All Time Popular Posts

Eq mkt Holidays for the 2017 year

Sr. No.

DateDayDescription
126-Jan-2017ThursdayRepublic Day
224-Feb-2017FridayMahashivratri
313-Mar-2017MondayHoli
404-Apr-2017TuesdayRam Navami
514-Apr-2017FridayDr.Baba Saheb Ambedkar Jayanti/ Good Friday
601-May-2017MondayMaharashtra Day
726-Jun-2017MondayId-Ul-Fitr (Ramzan ID)
815-Aug-2017TuesdayIndependence Day
925-Aug-2017FridayGanesh Chaturthi
1002-Oct-2017MondayMahatama Gandhi Jayanti
1119-Oct-2017ThursdayDiwali-Laxmi Pujan*
1220-Oct-2017FridayDiwali-Balipratipada
1325-Dec-2017MondayChristmas

*Muhurat Trading will be conducted. Timings of Muhurat Trading shall be notified subsequently.

The holidays falling on Saturday / Sunday are as follows:

Sr. No.DateDayDescription
109-Apr-2017SundayMahavir Jayanti
202-Sep-2017SaturdayBakri ID
330-Sep-2017SaturdayDasera
401-Oct-2017SundayMoharram
504-Nov-2017SaturdayGurunanak Jayanti