SN Smoothed Balance of Power v2

Hi all,

here is an updated version of the indicator script I published yesterday.

The goal of this indicator is to try and find darkpool activity. The indicator itself is not enough to fully identify darkpool but it should be able to detect quiet accumulation. What makes this Balance of Power different from others on TV is that it is smoothed by using a moving average.


- The values that are default are completely arbitrary except for the VWMA length (a 14-day period for the 1D chart is the norm). For instance the limit where it shows red/green I picked because it works best for the 1D chart I am using. Other TF's and charts will need tweaking of all the values you find in the options menu to get the best results.

- I modified the indicator such that it is usable on charts that do not show volume . HOWEVER, this chart is default to NYMEX: CL1! . To get different volume data this needs to be changed in the option menu.

- I am in no way an expert on darkpool/ HFT trading and am merely going from the information I found on the internet. Consider this an experiment.

- Lazybear for some of the plotting-code
- Igor Livshin for the formula
- TahaBintahir for the Symbol-code (although I'm not sure who the original author is...)
Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. You can favorite it to use it on a chart.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?
// author : SatNam
// credits to LazyBear and Igor Livshin

study(title="SN-BOP v2")
length=input(14, "CVWMA Length")
lengthSMA=input(25, "SMA Length")
colour=input(2, "Short/Long Limit")
bopmultiplier=input(8, "EMA BOP Multiplier")

PlotEMA=input(true, "Plot SMA?", type=bool)

symb  = input(defval="NYMEX:CL1!", type = string, title="Market with Volume Data")
hi = security(symb, period, high)
op = security(symb, period, open)
lo = security(symb, period, low)
cl = security(symb, period, close)
vol = security(symb, period, volume)
THL = (hi-lo) ? .1 : (hi-lo)

BuRBoO = (hi - op)/(hi-lo)
BeRBoO = (op - lo)/(hi-lo)
BuRBoC =(cl - lo)/(hi-lo)
BeRBoC =(hi - cl)/(hi-lo)
BuRBoOC = cl > 0 ? (cl-op)/(hi-lo) : 0
BeRBoOC = cl > 0 ? 0 : (op -cl)/(hi-lo)

BOP = ((BuRBoO+BuRBoC+BuRBoOC)/3) - ((BeRBoO+BeRBoC+BeRBoOC)/3)
cvwma = ((sum(BOP, length) * sum(vol, length)) / sum(vol,length))

barcolor = cvwma >=  colour ? green : cvwma <= -colour ? red: gray

plot(cvwma, style=columns, color = barcolor)
plot(PlotEMA?ema(BOP*bopmultiplier, lengthSMA):na, color=navy, linewidth=1)