The Detrended Price Trading Oscillator for MT5


The Detrended Price Oscillator, also known as DPO, was created to identify short-term trend changes, that is, small changes occurring within a long-term trend. Its calculations are based on the difference between the current price reading and a shifted moving average. Unlike other indicators, DPO does not calculate taking into account trend movements, this allows making its signals more accurate. The indicator is displayed in the lower window of the price chart, representing a moving average, which, under certain conditions, crosses its zero level from above or below.

Since the indicator is not recommended for use on large timeframes, it should be borne in mind that the value of the indicator period should also not exceed a certain norm, namely, values ​​above 21. In this case, the choice of a currency pair can be any.

The DPO indicator

Input parameters

Despite the complexity of reproducible calculations, the Detrended Price Oscillator indicator has only two input parameters in its settings that affect the internal operation of the indicator. The rest of the settings affect the visualization of the indicator, as well as adding additional levels, the intersection of which will be a certain signal.

  • MA_Period - period of the moving average of the indicator. By default, it has a value of 14, but it should be taken into account that the period should not exceed the value of 21.
  • BarsToCountInput - the number of bars to which the indicator calculations will be applied. The default value is 400.
DPO indicator input parameters mt5

Indicator signals

As mentioned earlier, the Detrended Price Oscillator indicator is presented as a moving average that crosses the zero level from the bottom up, and vice versa, from the top down. So, crossing the zero level line in a certain direction can be considered an indicator signal.

Signal for Buy trades:

  • -Moving average after crossing the zero level from below, changes its direction and moves up, breaking through the zero level.

After the line crosses the zero level from the bottom up, a long position can be opened. It should be closed if the line goes into the zone below the zero level.

Signal for Sell trades:

  • After being in the zone above the zero level, the moving average moves down, crossing the zero level from above.

After receiving such a condition, a sell trade can be opened on a certain candle, which should be closed after the reverse crossing of the zero level by the line.


The Detrended Price Oscillator indicator works with a practical absence of false signals, so it can be used both without additional indicators or advisers, and with them, forming a trading strategy. In addition to determining market entry points, the indicator can serve as a good helper in determining oversold and overbought zones. If take into account all the rules of trading, as well as pre-practice on a demo account, it can be achieved a stable profit from any trade.