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