IldarAkhmetgaleev

OBV Shadows

Overlay shows difference between OBV and OBV's moving average as green and red dos above and below cendles.
Designed to fast divergence detection.
Remove from Favorite Scripts Add to Favorite Scripts
study(title="OBV Shadow", shorttitle="OBVShad", overlay=true)
window_len = input(28, defval=28, minval=1, title='Window Lenght')
obv_len = input(14, defval=14, minval=1, title='OBV smooth Lenght')
price_spread = stdev(high-low, window_len)

obv = cum(change(close) > 0 ? volume : change(close) < 0 ? -volume : 0*volume)
smooth = sma(obv, obv_len)
obv_spread = stdev(obv - smooth, window_len)
shadow = (obv - smooth) / obv_spread * price_spread

out = shadow > 0 ? high + shadow : low + shadow
color = shadow > 0 ? green : red
plot(out, style=cross, color=color)
// out = close > close[1] ? shadow : -shadow
// plotarrow(out, colorup=green, colordown=red, transp=50, title='Volume Shadow')
I've tried OBV against price too. Does your code lock it against scale changes?

You have a couple misspellings in the code. *Length
Reply
IldarAkhmetgaleev MarvinMartian
it uses standart deviation to scale valeus, so it shows releative values, not absolute.
Reply
seems to work!
Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
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