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...)
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
// 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)