DPO-Detrended Price Oscillator

DPO-Detrended Price Oscillator

This version is identical, in calculations, to PRT’s built-in indicator, but this one can be used in autotrading, since it returns the current value, not the shifted one.

It also plots the shifted DPO like PRT.

If boolean variable ARROWS is ticked, then crossings between the current DPO and the one from the past, are signalled with arrows, in case thet are of interest.

———————————————————————————————————-

https://www.investopedia.com/terms/d/detrended-price-oscillator-dpo.asp
https://en.m.wikipedia.org/wiki/Detrended_price_oscillator

The detrended price oscillator (DPO) is an indicator in technical analysis that attempts to
eliminate the long-term trends in prices by using a displaced moving average so it does not react
to the most current price action. This allows the indicator to show intermediate overbought and
oversold levels effectively.
The detrended price oscillator is a form of price oscillator, like the “percentage price
oscillator” (PPO) and the “absolute price oscillator” (APO) both of which are forms of Gerald
Appel’s MACD indicator. The APO is an equivalent to the moving average convergence/divergence
(MACD) indicator while the PPO is an improved alternative to the APO or the MACD for use when a
stock’s price change has been large, or when comparing the oscillator behavior for different
stocks which have significantly different prices.
Although these are not so commonly used with the DPO, for the other price oscillators, as for the
MACD, a signal line is frequently generated for the price oscillators by taking an exponential
moving average (EMA) of the price oscillator values and plotting the two lines together.
A histogram can also be generated for the price oscillators, if desired, just as is done for the
MACD indicator.

Formula and calculation:

The DPO is calculated by subtracting the simple moving average over an “n” day period and
shifted n/2+1 days back from the price.

To calculate the detrended price oscillator:

Decide on the time frame that you wish to analyze. Set “n” as half of that cycle period.
Calculate a simple moving average for n periods.
Calculate (n / 2 + 1)
Subtract the moving average, from (n / 2 + 1) days ago, from the closing price:
DPO = Close – Simple moving average [from (n / 2 + 1) days ago]

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. KAMJKAZE • 01/14/2021 #

    Ciao Roberto, the prc built-in indicator can be setted to past MA or future MA. How Can i set this indicator to show the past MA ? I’’m Trying to adjust a strategy with this filter.. Thank you 🙂

  2. robertogozzi • 01/14/2021 #

    I don’t actually know what they are calculating. As soon as I know, I will post further info.

  3. robertogozzi • 01/14/2021 #

    It’s because they calculate future bars, that’s why it’s not possible to use that indicator with automated strategies.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Iván
2 weeks ago
Madrosat Bonjour ivan Quelle différence il y a t il entre Extra trend et ultra trend lequel est le p...
Iván
4 months ago
luxrun grazie Ivàn!
lee Thank you. Is it possible to convert this to a screener that displays instruments when bulli...
Iván //---------------------------------------------------------------// //PRC_Pollan Indicator /...
okeus Ciao, il tuo lavoro è incredibile, ti chiedo una cortesia è possibile veder un grafico con ...
kats BONJOUR je lai mis sur du renko , il est complexe car toujours a l'envers??? Peut être ne ...
RTR Great tool again and great job, thank you! So from what I see everytime Z-Score is over 0 m...
yas hi ivan I have logged this last week if when you get a chance if this can be converted ple...
Sever
3 years ago
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
robertogozzi An updated version can be found here https://www.prorealcode.com/topic/conversion-of-pine-sc...
jissey Bonjour Robertogozzi, cet indicateur est interessant mais serait-il possible de marquer la ...
robertogozzi Sure, but you should start a new topic on the Probuilder support forum. Thank you :)
poldoposta si potrebbe trovare una soluzione per sovrapporlo al prezzo?
robertogozzi Basta che tu clicchi sull'etichetta (tag) PREZZO del grafico (appena sotto l'angolo in alto ...
IV Mcm Good job !
FernetTrader think i found a solution!
monochrome Thanks for the indicator. Very interesting!
monochrome Can you please share how you made it work? I cant seem to make it work in a strategy
osupero https://www.screencast.com/t/2fCW8fkGsOeZ....solo posiciones largas por ahora
osupero https://www.screencast.com/t/MIaSZ2PRg
ALZ Hi JohnSher, Nice but not the same result Do you have the last itf of it ? Good result i...
Maz
8 years ago
Francesco78 very nice, thanks!
Wilko Interesting! Thanks for sharing!
BjornH Extremely nice, thanks!
s00071609 Hi, could you please suggest, what this codes gives, lowest[b](rsi[a]) -- just trying to us...
Nicolas lowest[b](rsi[a]) returns the lowest values of the RSI of "a" periods, over the last "b" per...
s00071609 Hi, what would be the code to get the price for last bullish DTOSC cross over. I am looking ...
lglmrc Can't make it work, says: "Define p variable"
Ezio Hi Xel and thanks, do you know if there is a way in PRC of reading/counting intraday ticks?...
inadis ive just discovered this, i must say very nice thanks.

Top