Detrended Price Oscillator Trading Strategy

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.

In this article, we make specific trading rules and backtest the Detrended price oscillator.

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 trading strategy  (DPO)

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 trading rules

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:

Asset ClassPortfolio Weight
U.S. Stocks20%
Foreign Stocks20%
U.S. Bonds20%
U.S. REITs20%
World Commodities20%
  • 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:

Portfolio SectorETF NameETF Ticker
U.S StocksSPDR S&P 500 ETF TrustSPY
Foreign (International) StocksiShares MSCI EAFE ETFEFA
U.S BondsVanguard Total Bond Market Index FundBND
U.S REITsiShares U.S. Real Estate ETFIYR
World CommoditiesInvesco DB Commodity Index Tracking FundDBC

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):

Net % ProfitCARMax. Sys % DrawdownCAR/MDDProfit Factor# TradesAvg % Profit/LossPeriodThreshold
150.985.75-19.890.292.181643.35150.03
126.235.08-21.890.231.772511.91150.025
84.123.78-17.960.211.433810.93150.02
151.335.75-27.050.212.112022.62200.03
137.195.38-26.80.21.852801.79200.025
87.363.89-24.610.161.473840.91200.02
88.913.94-24.310.161.712171.7350.02
44.82.27-21.050.111.81862.650.03
60.372.91-31.070.091.295420.53200.015
52.222.58-29.560.091.294110.6350.015
36.561.91-25.30.081.185660.36150.015
53.392.63-32.650.081.452091.44100.025
52.522.6-33.330.081.353140.85100.02
60.312.91-35.770.081.257690.3750.01
41.542.13-29.190.071.441381.82100.03
43.392.21-39.930.061.1415800.1350.005
25.41.38-39.420.041.127780.2200.01
32.41.72-43.680.041.185100.39100.015
17.690.99-25.740.041.21370.8150.025
15.220.86-32.840.031.078760.12150.01
19.581.09-40.210.031.0714340.08100.005
10.290.6-29.060.021.0413970.06150.005
13.430.77-40.580.021.0612220.08200.005
4.60.27-43.40.011.028470.07100.01

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:

Detrended Price Oscillator trading strategy backtest

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

Detrended Price Oscillator strategy performance and risk

Portfolio monthly and annual returns:

YearJanFebMarAprMayJunJulAugSepOctNovDecYr%
20070.8%-0.7%0.3%0.8%0.5%-1.0%-2.7%-1.8%2.8%2.1%-6.2%-2.2%-7.3%
2008-1.8%1.7%-1.5%3.5%2.0%-3.7%-0.2%-1.1%-5.6%-0.4%-3.7%7.5%-4.0%
2009-7.4%-0.0%-1.0%7.4%7.2%-0.2%4.3%3.0%1.5%0.5%1.9%1.2%19.1%
2010-1.0%-0.0%3.1%1.7%-5.5%-4.6%2.7%-1.8%4.1%2.5%-1.4%4.5%3.9%
20112.4%3.3%-0.7%2.7%0.6%-3.0%-1.0%-2.4%-5.6%7.8%-1.5%0.1%1.9%
20124.2%2.7%1.2%-0.5%-5.4%3.4%1.4%2.6%0.4%-0.3%0.6%1.6%12.1%
20132.6%0.4%1.7%2.9%-2.0%-1.1%2.0%-2.6%3.2%1.6%-0.1%1.2%10.1%
2014-1.1%3.4%0.1%1.3%1.6%0.9%-1.0%1.9%-2.5%2.4%1.4%-0.7%7.9%
20151.0%1.8%-1.4%2.1%-0.2%-1.1%0.4%-2.8%-0.8%3.0%-0.2%-0.6%1.1%
2016-3.1%-3.8%4.9%1.7%0.8%1.0%3.0%-1.4%-0.7%-2.0%0.2%2.0%2.1%
20171.0%2.0%-0.2%0.5%0.9%0.5%2.1%0.4%1.1%1.7%1.5%1.2%13.5%
20182.3%-5.3%0.6%1.0%1.4%0.3%0.9%1.0%0.3%-4.7%-0.9%-2.9%-6.2%
20194.6%1.3%1.7%1.4%-2.2%3.8%0.2%-0.5%1.9%1.4%0.7%1.4%16.7%
20200.0%-4.0%-7.3%-1.7%4.1%2.3%3.7%3.2%-2.7%-3.6%9.0%3.4%5.5%
20210.1%3.4%0.8%5.0%1.9%1.6%2.1%0.9%-1.9%4.8%-3.5%4.6%21.2%
2022-2.3%-0.3%1.7%-4.2%1.2%-6.4%5.2%-2.7%-3.0%0.4%2.4%-1.3%-9.3%
20231.2%-1.5%1.5%0.9%-1.8%1.6%N/AN/AN/AN/AN/AN/A1.9%

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

Statistical MetricPortfolioS&P 500 TR
Annual Return %5.08%8.95%
Exposure %75.25%100.00%
Risk Adjusted Return %6.75%8.95%
Max. drawdown-21.89%-55.19%
CAR/MaxDD0.230.16
Standard Deviation10.99%22.64%
Sharpe Ratio (3% risk-free)0.190.26

There are individual performance stats per asset class since inception:

TickerExposure %CARRARMax. Sys % DrawdownCAR/MDDAnual Standard Deviation (%)Sharpe Ratio (3% Risk-Free Rate)
IYR68.418.4512.35-48.240.1820.430.27
SPY75.226.849.09-48.080.1415.710.25
BND90.42.242.48-19.580.114.64-0.16
EFA85.584.375.1-49.340.0918.080.08
DBC52.153.697.07-43.190.0915.20.05

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

Detrended Price Oscillator strategy returns

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.

Similar Posts