4.3.2.1 What is the MACD and how is it calculated?
The MACD does not completely fall into either the trend-leading indicator or trend following indicator; it is in fact a hybrid with elements of both. The MACD comprises two lines, the fast line and the slow or signal line. These are easy to identify as the slow line will be the smoother of the two.
NIFTY chart below illustrates the basic MACD lines
Step1. Calculate a 12 period exponential moving average of the close price.
Step2. Calculate a 26 period exponential moving average of the close price.
Step3. Subtract the 26 period moving average from the 12 period moving average. This is the fast MACD line.
Step4. Calculate a 9 period exponential moving average of the fast MACD line calculated above. This is the slow or signal MACD line.