This type of oscillator revolves around using two moving averages and plotting the divergence between them. To understand these oscillators, a small detour to look at moving averages is appropriate.
A moving average is calculated by averaging the closing price over the previous x periods. For example, a simple moving average of closing price over eight days is the sum of the closing price of those last eight days divided by eight. So, to get one point on an eight-day moving average, you need eight data points. A simple moving average is shown in the below figure.

A single moving average is of limited use. All it comprises is a lagging average of what has gone on before. Lagging means the price action itself will have changed direction before the moving average. In some instances, a moving average performs a similar function to a trendline on a chart in that it will act as a line of support in upward moves and a line of resistance in downward moves. As such, the crossing of a single moving average can signal a change in trend. There is much more that can be done with moving averages, though.
When you combine two moving averages, you get clearer signals. Essentially, you pick a shortterm moving average and a long-term moving average and take your trading signals from when they cross each other. The two most significant patterns formed by the crossing of two moving averages are the golden cross and the dead cross.