RicardoSantos

[RS]Detrended Price Oscilator System A

dpo
778 0 96
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)
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
Home Stock Screener Forex Signal Finder 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
Profile Profile Settings Account and Billing Priority Support Ideas Published Followers Following Private Messages Chat Sign Out