The concept behind the MACD is fairly straightforward. Essentially, it calculates the difference between an instrument's 26-day and 12-day exponential moving averages (EMA).2 Of the two moving averages that make up the MACD, the 12-day EMA is the faster one, while the 26-day is slower.
In the calculation of their values, both moving averages use the closing prices of whatever period is measured. On the MACD chart, a nine-day EMA of the MACD itself is plotted as well, and it acts as a trigger for buy and sell decisions. The MACD generates a bullish signal when it moves above its own nine-day EMA, and it sends a sell sign when it moves below its nine-day EMA.
The MACD histogram is an elegant visual representation of the difference between the MACD and its nine-day EMA. The histogram is positive when the MACD is above its nine-day EMA and negative when the MACD is below its nine-day EMA. If prices are rising, the histogram grows larger as the speed of the price movement accelerates, and contracts as price movement decelerates. The same principle works in reverse as prices are falling.
The chart below is a good example of a MACD histogram in action: