RicardoSantos

[RS]Temporal Open Diferential V0

80 0 8
EXPERIMENTAL: Diferencial from Opening "Timeframe" Price
Remove from Favorite Scripts Add to Favorite Scripts
study("[RS]Temporal Open Diferential V0")
otracker = input(title='Open Timeframe:', defval='M', type=string)
src = input(title='Source:', type=source, defval=hl2)
SHOW_MA = input(title='Show Slow Moving Average:', type=bool, defval=true)
smooth = input(2)
MA_length = input(8)
SHOW_HHL = input(title='Show Historic Extremes:', type=bool, defval=true)

newbar(res)=>change(time(res)) != 0

track = sma(src - security(tickerid, otracker, open), smooth)
ma = sma(track, MA_length)
track_color = track > 0 and rising(track, 1) ? green: track>0?olive : track < 0 and falling(track, 1) ? maroon : track < 0 ? orange : gray

hline(0, color=black)
plot(track, style=columns, color=track_color)
plot(not SHOW_MA ? na : ma, color=black)
plot(newbar(otracker)?0:na, style=cross, color=black, linewidth=3)

hh=not SHOW_HHL ? na : na(track)? 0 : track >= hh[1] ? track : hh[1]
ll=not SHOW_HHL ? na : na(track)? 0 : track <= ll[1] ? track : ll[1]

plot(not SHOW_HHL ? na : hh, color=hh == hh[1]?black:na)
plot(not SHOW_HHL ? na : ll, color=ll == ll[1]?black:na)
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体中文
繁體中文
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out