this
Description
The Detrended Oscillator (DO) is usually used with price, but can operate on any series. Since it operates on price it is called the DPO most of the time. EAS also presents the oscillator as calculated from volume and refers to the resulting indicator from that calculation as DVO. The DO is calculated by subtracting the input data from an SMA of the input data. The lookback period for the difference calculation is a function of the specified SMA period. DO allows for the plotting of different colors by having an extra input. The thick line is the value of the DO and the and the thin line is an EMA of the DO value to be used as a signal line. When the DO is above zero and rising it is a bullish indication. The reverse is true for below zero and falling. It is mainly used to gage the strength of short term trends by minimizing the effect of longer term cycles. Cylces more than p1 in length are minimized as to their effect on the DO indicator. It is a momentum indicator.



The View title displays the name of the indicator and the SMA lookback period and the EMA period. The Titlebar Chart Code for this indicator is dpo or dvo for a price oscillator or a volume oscillator. (see EAS Titlebar Chart Codes)

Inputs
The lookback periods define the period over which the DO is calculated and the EMA signal line. p1 defines both the comparison SMA period and the difference calculation lookback period. The difference calculation lookback is int(p1/2+1). p0 is the lookback period for the EMA signal line.

Choices for color are: "blue", "red", "green", "black" and "purple". color must be input as a character matrix. The DO color and signal line color are automatically set by these inputs.

Output Data & Plotting
If returnflag is set to "data" a (b-a+1)-row by 2-column matrix of data will be returned. The output is only valid for data points beyond the lookback period, p0, in time. The first column of the output is the value of the DO at any given point in time and the second column is the value of the EMA signal line.

Keep in mind that this indicator may only be valid for the mmddyyref date matrix, since the data is normally filtered to match the by matching the data matrices for the Current & Reference Tickers. If the input data for each ticker was a match then no filtering was necessary and mmddyy could be used for scaling the date. To be safe, however, any chart date scaling should occur using mmddyyref as the input to datescale.

Background Reading
Further information regarding this indicator can be found in the following resources:
Equis.com Detrended Price Oscillator