IldarAkhmetgaleev

OBV Shadows

245 3 33
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')
seems to work!
Reply
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
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
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