Monday, June 10, 2024

Bull Bear Power: the one and only one Indicator

 study(title="BBPOWER_V1", shorttitle="BB Power")

lengthInput = input(13, minval=2, maxval=50, title="Length")

highPrices = high
lowPrices = low
closePrices = close

// Calculate Exponential Moving Average (EMA) of the close prices
closeEMA = ema(closePrices, lengthInput)

// Calculate Bull Power and Bear Power
bullPower = highPrices - closeEMA
bearPower = closeEMA - lowPrices

// Calculate BBP by adding Bull Power and Bear Power
bbp = bullPower + bearPower

// Paint BBPower using histogram style with dynamic coloring
hline(0, color=gray, linestyle=solid, linewidth=1)
bbpColor = (bullPower- bearPower) >= 0 ? green : red
plot(bbp, color=bbpColor, style=histogram, linewidth=2, title="BBPower")

==> Please Use and Succeed\\



No comments:

Post a Comment