SatNam

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.

Notes:

- 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.

Credits:
- 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...)
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
// 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
hline(0)

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