Hello! I would like to test the indicator Balance of power! The Balance of Power indicator measures the market strength of buyers against sellers by assessing the ability of each side to drive prices to an extreme level. The calculation is: Balance of Power = (Close price – Open price) / (High price – Low price)
I found this code in internet but it doesn´t work in Prorealtime so I need your help please! Thank you very much
//@version=3
study(“True Balance of power”)
per=input(30, title=”periods for Emoline”, type=integer, step=1, minval=4)
trhi = max(high, close[1]) //true high
trlo = min(low, close[1]) //true low
trop = close[1] //true open
bop = 100*(close-trop)/(trhi-trlo) //True Balance of Power as percent
lin= 1.5*linreg(bop, per, 0) //linear regression as emoline
bgcolor(lin0?green:orange, style=columns) //plot BOP as columns
plot(lin, title=”Emoline”, color=rising(lin,2)?blue :black, linewidth=3) //plot emoline as line
hline(0, linestyle=line) //zero level
Hi, welcome to PRC forums, I’m moving your post from Spanish forum “Soporte ProBuilder” to English forum “ProBuilder support”, as the custom on PRC forums is to use the language of the forum we post in.
I translated the indicator into ProBuilder version, you can find and download it here now: Balance of Power
Hi, Nicolas,your version is the True Balance of Power,I have this version:
REM TRUE BALANCE OF POWER
// código original de eykpunter para la plataforma Tradingview
//reforma del script de LazyBear
//@version=3
//adaptado para Prorealtime por bolsatrilera
per=30 //title="periods for Emoline", type=integer, step=1, minval=4)
hihi = max(high, close[1])
lolo = min(low, close[1])
opop = close[1]
bop = 100*(close-opop)/(hihi-lolo) //part of range
lin= 1.5*LinearRegression[per](bop)
if lin < 0 then
backgroundcolor (252,213,208)
endif
if bop > 0 then
r=154
g=205
b=50
else
r=255
g=165
b=0
endif
return bop coloured (r,g,b)style (histogram)as "True Bop",lin style(line,2)as "Emoline", 0 as "0"
The Balance of Power by Lazy Bear is this:
REM BALANCE OF POWER
// @author LazyBear
//código original para la plataforma Tradingview
// Balance Of Power - BOP
//adaptación para Prorealtime por bolsatrilera
length=14
BOP=(close - open) / (high - low)
if BOP >0 then
if BOP > BOP[1] then
r = 154
g = 205
b = 50
else
r=255
g=165
b=0
endif
elsif BOP >BOP[1] then
r=255
g=165
b=0
else
r=255
g=0
b=0
endif
PlotEma=Average[length](BOP)
return BOP coloured (r,g,b)style(histogram)as "Bop",PlotEMA coloured (0,0,255)as "EMA",0 as "0"