The MACD is the difference between a 26-day and 12-day exponential moving average of closing prices. A 9-day EMA, called the "signal" line is plotted on top of the MACD to show buy/sell opportunities.
The basic MACD trading rule is to sell when the "slow line" of the MACD falls below the faster 9-Day EMA line (known as a "signal line crossover") and similarly, a buy signal occurs when the MACD rises above its signal line.
An important point to remember is that the MACD is regarded as most effective in wide-swinging trading markets, just like any moving average crossover. Its weakness is that, when the market is trendless, the MACD tends to generate lots of false / unprofitable buy and sell signals
You can read more about the MACD Strategy here.