Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal


Detrended Price Oscillator (DPO) - indicator for MetaTrader 5

MetaQuotes Software Corp. | English Русский 中文 Español Deutsch 日本語 Português

votes: 32
2010.01.26 11:12
2016.11.22 07:32
dpo.mq5 (2.79 KB)view

Detrended Price Oscillator removes the trend effect of price movement. This simplifies the process of finding out cycles and overbought/oversold levels.

Long-term cycles consist of several shorter cycles. Analyzing such short components helps to define crucial moments of the cycle's development. DPO gives a chance to eliminate the influence on prices of long-term cycles. To calculate DPO you should take a certain period. Remove cycles that are longer than the chosen period from price dynamics, and leave shorter cycles. Half of the cycle's length is used for smoothing. We recommend using a period of 21 or less.

The bounds (overbought/oversold levels) come from the history of previous behavior of prices. It is recommended to stand in a long position if DPO first falls below the resale level and then gets above it. Crossing of the zero point from above followed by a rise above that level is also a signal for opening a long position. Everything is vice versa for short positions.

Detrended Price Oscillator

Detrended Price Oscillator


DPO = CLOSE - SMA (CLOSE, (N / 2 + 1))


  • SMA - simple moving average;
  • CLOSE - the closing price;
  • N - the period of the cycle (if N is equal 12, then DPO corresponds to the DiNapoli Detrend Oscillator).

Translated from Russian by MetaQuotes Software Corp.
Original code:

DeMarker (DeM) DeMarker (DeM)

The Demarker Indicator (DeM) is based on the comparison of the period maximum with the previous period maximum. When the indicator falls below 30, the bullish price reversal should be expected. When the indicator rises above 70, the bearish price reversal should be expected.

Custom Moving Average Custom Moving Average

The Custom Moving Average is example of the Custom User Indicator - it calculates and shows the Moving Average.

Envelopes Envelopes

The Envelopes Indicator is formed by two Moving Averages, one of them is shifted upward and another one is shifted downward. The selection of optimum relative number of band margins shifting is determined with the market volatility: the higher the latter is, the stronger the shift is.

Force Index  (FRC) Force Index (FRC)

The Force Index Indicator was developed by Alexander Elder. This index measures the Bulls Power at each increase, and the Bulls Power at each decrease.