RicardoSantos

[RS]DPO Normalized MA

449 0 58
DPO Weighted MA System.
Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]DPOMA System A", shorttitle="[RS]DPOMASA", overlay=true)

// DPO
dpo_length = input(24)
dpo_src = ohlc4
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) * 1
dpo_df = (dpo_disp / dpo_src) * 1

//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)

// ma
pip = 0.0001 * close
ma1 = ema(dpo_src, dpo_length)
ma2 = sma(ma1 + (ma1 * (dpo_diff-dpo_trend)), 6) 

//plot(ma1, color=green)
plot(ma2, color=black, linewidth=3)

bc = dpo_src > ma2 ?
        close > open ? lime : green :
        dpo_src < ma2 ?
        close > open ? red : maroon :
        close > open ? silver : gray

barcolor(bc)
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
日本
한국
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
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out