RicardoSantos

[RS]Detrended Price Oscilator System A

dpo
633 0 63
dpo
DPO with modified formula for percentual values for scale ability trend line and histogram, rest i leave to you to explore..
Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]Detrended Price Oscilator System A", shorttitle="[RS]DPOSA")

dpo_length = input(24)
dpo_src = close
dpo_disp = (dpo_src - sma(dpo_src[round(dpo_length/2) + 1], dpo_length))
dpo = (dpo_src - sma(dpo_src, dpo_length))

dpo_f = (dpo / dpo_src) * 100
dpo_df = (dpo_disp / dpo_src) * 100

//dpo_trend = dpo_disp - dpo
//dpo_cycle = dpo_trend + dpo_disp
dpo_trend = dpo_df - dpo_f
dpo_cycle = dpo_trend + dpo_df

dpo_h = highest(dpo_cycle, dpo_length)
dpo_l = lowest(dpo_cycle, dpo_length)

dpo_hlc(s) => s == s[1] ? gray : na
plot(dpo_h, style=line, color=dpo_hlc(dpo_h), linewidth=2)
plot(dpo_l, style=line, color=dpo_hlc(dpo_l), linewidth=2)

dpo_diff = dpo_cycle-dpo_trend

plot(dpo_cycle, color=black, style=line, linewidth=3, transp=50)

plot(dpo_diff, style=histogram, color=gray, linewidth=4)

tc = rising(dpo_trend, 1) ? green : maroon
plot(dpo_trend, color=tc, style=circles, linewidth=3, join=true)

hline(0)
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out