Developed by Gerald Appel, the Moving Average Convergence/Divergence Indicator (MACD) is one of the simplest and most reliable indicators available today. The first line created is the MACD Graph (thick black line) and is calculated by taking the difference between the 26 day Exponential Moving Average (EMA), based on closing price, and the 12 day EMA, which creates a momentum oscillator that oscillates above and below zero. The second line created is the MACD trigger line (thin red line) which is a smoothed, 9 day EMA of the MACD graph.
Below is an example of the MACD indicator using the daily chart for Cisco Systems. The top price graph of CSCO is shown with its associated 12 day (light blue) and 26 day (dark blue) EMAs. The MACD Graph is the thick black line and we can see when the 12 day EMA crosses above the 26 day EMA, the black MACD Graph crosses above its center line. The thin red line is a smoothed, 9 day EMA of the black MACD Graph, and this creates the MACD signal line. The green/red histogram on the MACD indicator is the difference between the black MACD graph and the red MACD signal line. When the histogram is above the center line and is green, this is a bullish indicator, and when the histogram is below the center line and is red, this is a bearish indicator. Due to how the red signal line interacts with the black MACD graph, this indicator does have some leading, predictive qualities where it will trigger a bullish or bearish signal prior to the actual price move of the underlying security.
The traditional way to use the MACD indicator is to consider each point of intersection between the black MACD graph and the red MACD signal line and use these crossovers as a trading signal. Therefore, one might decide to buy a stock when the black MACD line crosses above the red MACD Signal line pushing the histogram above the center line, and to sell the stock when the black MACD line crosses below the red MACD signal line pushing the histogram below the center line.