Aobv Dpo

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

//@version=5

indicator(title="[AA][Indicator] AOBV Detrended Price Oscillator", shorttitle="AOBV


DPO", format=format.price, precision=2, timeframe="", timeframe_gaps=true)
period_ = input.int(21, title="Length", minval=1)
isCentered = input(false, title="Centered")
barsback = period_/2 + 1
source = ta.cum(math.sign(ta.change(close)) * volume * math.abs(close - open) / (2
* (high - low) - math.abs(close - open)))

ma = ta.sma(source, period_)
dpo = isCentered ? source[barsback] - ma : source - ma[barsback]
plot(dpo, offset = isCentered ? -barsback : 0, title="Detrended Price Oscillator",
color=#43A047)
hline(0, title="Zero Line", color = #787B86)

You might also like