LazyBear

Indicator: CCI coded OBV

OBV is colored green if CCI > threshold, red if CCI < threshold.

Both "threshold" and "CCI Length" can be customized using the options page.

Indicator also displays a 13EMA (length can be changed) over OBV.
Remove from Favorite Scripts Add to Favorite Scripts
// 
// @author LazyBear
// 
study("CCI coded OBV", shorttitle="CCIOBV_LB")
src = close
length = input(20, minval=1, title="CCI Length")
threshold=input(0, title="CCI threshold for OBV coding")
lengthema=input(13, title="EMA length")
obv(src) => 
    cum(change(src) > 0 ? volume : change(src) < 0 ? -volume : 0*volume)
    
o=obv(src)
c=cci(src, length)
plot(o, color=c>=threshold?green:red, title="OBV_CCI coded", linewidth=2)
plot(ema(o,lengthema), color=orange, linewidth=2)
Amazing indicator, genius. I started demo trading 3 months ago and have lost 5k all in all so doing pretty poorly

This indicator is a game changer allied to a few others yes but this is key. Have suddenly become consistently profitable

I doff my hat to you lazy bear
Reply
Does this indicator only work with BTCUSD?

I can't seem to get it working with any other data :/
Reply
OBV needs volume. May be you tried it on FX? If problem still persists, can you post a chart? Thx.
Reply
Sora0102 LazyBear
(I deeply apologize for late response.)

snapshot

This is what the chart looks like when I used it on a EUR/USD 3 minute chart.

snapshot

This is GBP/USD in another time frame
Reply
TV doesn't expose FX volume. Only instruments with volume will work.
Reply
@LazyBear Just trying to understand better how this is working. Since OBV depends on the start date - when does tradingview start calculating the OBV when you use this code? From the beginning of the data it has? A month back? Thanks!
Reply
It starts calculation from the first data item in the series. So, for BTCUSD, BITSTAMP has more data than OKCOIN, for ex.,

Function of interest in this script is obv(src).
Reply
sungkhum LazyBear
Thanks!
Reply
sungkhum LazyBear
I just created a bot based on this idea: https://discuss.tradewave.net/t/obv-lite-bot/362
Fun!
+1 Reply
This seems really effective especially considering the small amount of code on this one. Nice one.
Reply
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
ประเทศไทย
Việt Nam
日本
한국
简体
繁體
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