XXDPO – indicator for MetaTrader 5


Detrended Price Oscillator (DPO) is a technical indicator that shows the market overbought/oversold states and also can be used for getting buy/sell signals.

It sorts out trends to concentrate on basic price movement cycles. To achieve this, the moving average transforms into the line and price changes below and above it become a trend oscillator.

This indicator is used to highlight short-term cycles, as the analysis of short-term components of the long-term cycles can be useful in determining main reversal points of the latter. DPO does not consider long-term prices cycles making short-term cycles more noticeable.


This DPO version is calculated the following way:

XXDPO = XMA(Price[bar] – XMA(Price[bar] , SMOOTH_Period) , DPO_Period)


  • XMA – smoothing algorithm;
  • Price[] – current price of a financial asset;
  • SMOOTH_Period – final indicator smoothing period;
  • DPO_Period – DPO smoothing period;
  • bar – bar index.

Working with trading signals:

If DPO is above its zero line (i.e., the price is above its moving average), it is a bullish signal. If DPO is below the zero line (i.e., the price is below its moving averages), it is a bearish signal.

Long-term cycles reversal points (divergencies):

  • if the chart generates more high peak or more deep bottom, then the price upward/downward reversal will follow;
  • if a peak or a bottom is lower/higher than the previous one, the price will fall.

There are two buy/sell signals interpretations.

We should buy when:

  1. DPO crosses the zero line upwards;
  2. DPO is located in the oversold area confirmed by previous lows and at the same time the upper line of the channel is being broken both by DPO and the price that is limiting descending price movement.

We should sell when:

  1. DPO crosses the zero line downwards;
  2. DPO is located in the overbought area confirmed by previous maximums and at the same time both DPO and the price are breaking a support line of an ascending trend.

The indicator is rarely used for getting trading signals. It should be noted that the indicator can be effective enough only when it is used together with other indicators. Nevertheless, it is a useful tool revealing the cycles for setting the optimal width of other indicators windows.

This indicator allows to select smoothing and averaging algorithms out of ten possible versions:

  1. SMA – simple moving average;
  2. EMA – exponential moving average;
  3. SMMA – smoothed moving average;
  4. LWMA – linear weighted moving average;
  5. JJMA – JMA adaptive average;
  6. JurX – ultralinear smoothing;
  7. ParMA – parabolic smoothing;
  8. T3 – Tillson’s multiple exponential smoothing;
  9. VIDYA – smoothing with the use of Tushar Chande’s algorithm;
  10. AMA – smoothing with the use of Perry Kaufman’s algorithm.

It should be noted that Phase1 and Phase2 parameters have completely different meaning for different smoothing algorithms. For JMA it is an external Phase variable changing from -100 to +100. For T3 it is a smoothing ratio multiplied by 100 for better visualization, for VIDYA it is a CMO oscillator period and for AMA it is a slow EMA period. In other algorithms these parameters do not affect smoothing. For AMA fast EMA period is a fixed value and is equal to 2 by default. The ratio of raising to the power is also equal to 2 for AMA.

The indicator uses SmoothAlgorithms.mqh library classes (must be copied to the terminal_data_folder\MQL5\Include). The use of the classes was thoroughly described in the article “Averaging Price Series for Intermediate Calculations Without Using Additional Buffers”.

Recommended MT5 Brokers

XM Broker

  • Free $50 To Start Trading Instantly! (Withdraw-able Profit)
  • Deposit Bonus up to $5,000
  • Unlimited Loyalty Program
  • Award Winning Forex Broker
  • Additional Exclusive Bonuses Throughout The Year

XM broker

>> Sign Up for XM Broker Account here <<

FBS Broker

  • Trade 100 Bonus: Free $100 to kickstart your trading journey!
  • 100% Deposit Bonus: Double your deposit up to $10,000 and trade with enhanced capital.
  • Leverage up to 1:3000: Maximizing potential profits with one of the highest leverage options available.
  • ‘Best Customer Service Broker Asia’ Award: Recognized excellence in customer support and service.
  • Seasonal Promotions: Enjoy a variety of exclusive bonuses and promotional offers all year round.

fbs broker

>> Sign Up for FBS Broker Account here <<


(Free MT5 Indicators Download)

Click here below to download:

XXDPO – indicator for MetaTrader 5

Get Smarter About Forex Trading Using Indicators

Join 100,000+ subscribers and get our 5 min daily newsletter on what matters in forex.

We do not sell or share your information with anyone.


Please enter your comment!
Please enter your name here