# Detrended Price Oscillator Trading Strategy (DPO) – Rules, Setup, Backtest, Returns Analysis

Detrended Price Oscillator (DPO) is a technical analysis indicator. According to the author’s idea, the indicator is built without considering trend movements on the chart, which allows a more accurate determination of overbought and oversold levels.

Similar to a moving average, it also filters out directionality (trend) in price values, making it easier to spot cyclicality.

The indicator determines cyclicality by plotting the moving average as a horizontal straight line and then placing price values along this line according to their relation to the moving average.

Related reading: Are you searching for other indicator trading strategies? (We have plenty more)

## Detrended Price Oscillator (DPO) example

Visual representation of the Detrended Price Oscillator with a 20-month period applied on the SPY (S&P 500) price chart:

# Detrended Price Oscillator Formula

Let’s look in more detail at the formula:

DPO = [Close Price from 2/N+1 periods ago] – [N period SMA]

where

N = Number of periods used for the look-back period

SMA = Simple Moving Average

## How to Calculate The Detrended Price Oscillator

Here’s an example of how you can use the indicator:

1. Determine a lookback period, such as 20 periods;
2. Find the closing price from n/2 +1 periods ago. If using 20 periods, this is the price from 11 periods ago;
3. Calculate the SMA for the last N periods. In this case, 20;
4. Subtract the SMA value (step 3) from the closing price N/2 +1 periods ago (step 2) to get the DPO value.

## Detrended Price Oscillator Strategy Rules

Since Detrended Price Oscillator is an oscillator similar to oscillators like Stochastic, we will use a simple counter-trend strategy:

• We will buy if the DPO reaches oversold levels and crosses the -X% level from top to bottom;
• We will sell if the DPO reaches overbought levels and crosses the +X% level from the bottom up;
• We will use short-term DPO with an N-day period.

This is what the DPO strategy rules look visually with a 5-day period DPO, -1% oversold level and +1% overbought level:

## Detrended Price Oscillator Strategy (DPO) Portfolio

Since we need to have a portfolio to backtest the Detrended Price Oscillator strategy, we will use the following five asset classes with equal portfolio weightings:

• U.S Stocks – U.S. large- and mid-cap growth and value stocks that virtually replicate the benchmark S&P 500 stock index;
• Foreign Stocks – non-U.S. large- and mid-cap stocks of different countries outside the US that have a low correlation with U.S. stocks;
• U.S Bonds – short-, medium- and long-term U.S. treasury, municipal, and investment-grade corporate bonds;
• REITs (real estate investment trusts) – they have the same rewards and risks as “traditional” stocks but also have a historically low correlation with “traditional” stocks and various types of bonds;
• Commodities – they are alternative types of investment and include metals, wood, oil, gas, grains, meat and many other tangible commodities. The advantage of commodities is that their market dynamics do not depend on each other and do not depend on the market dynamics of stocks, bonds, REITs, and other “traditional” assets.

We have picked these ETFs, which are well diversified, have high liquidity, and a long performance history:

## Backtesting Of The Detrended Price Oscillator Strategy

Backtesting conditions are the following:

• The simple mean-reverting strategy described above is used;

• The above-described ETFs with the appropriate weights are picked;

• Historical quotes are adjusted for dividends;

• Backtesting interval is from 2007 until today.

First, let’s run the backtester in optimization mode to choose the most optimal strategy parameters. Results are sorted by CAR/MDD column (the last two columns show the periods and thresholds):

As we can see, the most optimal parameters are Period = 15 and Threshold = 2.5%. With these parameters, we get a statistically significant number of trades (251) and quite a high Avg P/L (1.91%).

Now let’s run the backtester and get the results for these particular settings.

This is what the portfolio equity curve looks like:

Portfolio underwater curve (drawdowns, i.e., decline in value from a relative peak value to a relative trough):

Portfolio monthly and annual returns:

Portfolio performance statistics compared to benchmark S&P 500 Total Return index:

There are individual performance stats per asset class since inception:

Below is the equity curve of the best-performing asset class (IYR):

## Conclusion On The Detrended Price Oscillator Strategy

The mean-reverting DPO strategy works, but it fails to beat buy and hold for most assets. However, volatility and risk are lower, and the Detrended Price Oscillator can thus be used as a drawdown-reduction filter for many timing models.

## FAQ:

What is the Detrended Price Oscillator (DPO)?

The Detrended Price Oscillator is a technical analysis indicator designed to eliminate trend movements on the chart, providing a more accurate determination of overbought and oversold levels. Unlike traditional indicators, DPO filters out directionality (trend) in price values, focusing on cyclicality. It plots the moving average as a horizontal line and positions price values along this line based on their relation to the moving average.

How can the Detrended Price Oscillator be used to reduce drawdowns in a portfolio?

While the mean-reverting DPO strategy may not outperform buy and hold, it can serve as a drawdown-reduction filter for many timing models. By incorporating DPO into a portfolio strategy, volatility and risk can be lower, contributing to more stable performance.

What are the key statistics to consider when evaluating the performance of the Detrended Price Oscillator strategy?

Key statistics include Annual Return %, Exposure %, Risk-Adjusted Return %, Max. Drawdown, CAR/MaxDD ratio, Standard Deviation, and Sharpe Ratio. These metrics provide insights into the strategy’s profitability, risk management, and overall effectiveness.