Pine Script (TradingView)
هذا مثال Pine Script على TradingView لهذا المؤشر. الصقه في Pine Editor داخل TradingView، اضفه الى الرسم البياني، ثم عدل الاعدادات حسب السوق والاطار الزمني.
//@version=6
indicator("Detrended Price Oscillator (DPO)", overlay=false)
length = input.int(20, "DPO Length")
shift = math.round(length / 2) + 1
dpo = close - ta.sma(close, length)[shift]
longSignal = ta.crossover(dpo, 0)
shortSignal = ta.crossunder(dpo, 0)
plotshape(longSignal, style=shape.triangleup, location=location.bottom, color=color.green, size=size.small)
plotshape(shortSignal, style=shape.triangledown, location=location.top, color=color.red, size=size.small)
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
plot(dpo, "DPO", color=dpo >= 0 ? color.teal : color.orange)