Balance of Power

Category: Indicators By: Nicolas Created: October 11, 2017, 2:07 PM
October 11, 2017, 2:07 PM
Indicators
2 Comments

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) The resulting value can be smoothed by a moving average.

Traders may use this indicator to help:

  • Identify the direction of a trend.
  • Find divergences between the price and the BoP in order to identify a potential trend reversal or trend continuation setup.
  • Take advantage of overbought and oversold conditions.

(description found on the web)

Code converted from Pinescript (tradingview) version by a request in the english indicators forum section.

//PRC_True Balance of Power | indicator
//11.10.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from Pinescript version

//---settings
//per=30 //periods for Emoline
//---end of settings

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*linearregression[per](bop) //linear regression as emoline

r=0
g=255
if bop<0 then
 r=255
 g=140
endif

return bop coloured(r,g,0) style(histogram) as "BOP", lin style(line,3) as "Emoline"

 

Download
Filename: PRC_True-Balance-of-Power.itf
Downloads: 207
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...