TradingView
RafaelZioni
23 lip 2018 21:08

Cumulative Net Volume 

Bitcoin / TetherUSBinance

Opis

This indicator calculate the Cumulative Net Volume (volume in versus volume out) as seen in red and green cross
I normalize it to be as price indicator -then using color setting it easy to see when volume influx is positive compare to negative period
next step -I add rsi and Bollinger to highlight the area where volume is going up or down with the best period by rsi and Bollinger (green red)

it easy indicator for starter to see where the best buy or sell point
have fun
Komentarze
RafaelZioni
study(title="Cumulative Net Volume", shorttitle="Cumulative Net Volume", overlay=true)
///////////// RSI
RSIlength = input(6,title="RSI Period Length")
RSIoverSold = 30
RSIoverBought = 50
price = close
vrsi = rsi(price, RSIlength)


///////////// Bollinger Bands
BBlength = input(200, minval=1,title="Bollinger Period Length")
BBmult = 2 // input(2.0, minval=0.001, maxval=50,title="Bollinger Bands Standard Deviation")
BBbasis = sma(price, BBlength)
BBdev = BBmult * stdev(price, BBlength)
BBupper = BBbasis + BBdev
BBlower = BBbasis - BBdev
source = close
buyEntry = crossover(source, BBlower)
sellEntry = crossunder(source, BBupper)
src = close
nv = change(src) > 0 ? volume : change(src) < 0 ? -volume : 0*volume // net volume of positive and negative volume
cnv = cum(nv) // cumulative net volume
cnv_tb = cnv - sma(cnv,15) //normalized 15 bars moving average
window_len = input(28, defval=28, minval=1, title='Window Lenght')

v_len = input(14, defval=14, minval=1, title='OBV smooth Lenght')
price_spread = stdev(high-low, window_len)

v = cnv - sma(cnv,15)
smooth = sma(v, v_len)
v_spread = stdev(v - smooth, window_len)
shadow = (v - smooth) / v_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')
up= out>close and vrsi<RSIoverSold and source< BBlower
down=out<close and source> BBupper
up1=out>close
down1=out<close
buy =crossover(out,close) nd vrsi<RSIoverSold and source< BBlower
sell = crossunder(out,close)
plotshape(sell, title="sell", style=shape.triangledown,location=location.abovebar, color=red, transp=0, size=size.tiny)
plotshape(buy, title="buy", style=shape.triangleup,location=location.belowbar, color=green, transp=0, size=size.tiny)
alertcondition(buy, title='buy', message='go long')
alertcondition(sell, title='sell', message='go short')
bgcolor(up > 0 ? green : na, transp=50)
bgcolor(down > 0 ?red : na, transp=50)
bgcolor(up1 > 0 ? lime : na, transp=90)
bgcolor(down1 > 0 ?orange : na, transp=90)
Więcej