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
United States
United Kingdom
India
Deutschland
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 Website & Broker Solutions 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