Nicolas

Bar Count Reversals (Pivot Points High/Low)

Category: Indicators By: Nicolas Created: August 30, 2016, 7:32 PM
August 30, 2016, 7:32 PM
Indicators
9 Comments
Bar Count Reversals (Pivot Points High/Low)

Pivot Points (High/Low), also known as Bar Count Reversals, are used to anticipate potential price reversals. Pivot Point Highs are determined by the number of bars with lower highs on either side of a Pivot Point High. Pivot Point Lows are determined by the number of bars with higher lows on either side of a Pivot Point Low.

For example, a Pivot Point High, with a period of 5, requires a minimum of 11 bars to be considered a valid Pivot Point. A minimum of 5 bars before and after the Pivot Point High all have to have lower highs.

The default period is set to 10 (p=10). It means that the whole calculation are made within 11 bars (10 bars with a pivot bar on the middle of them).

(coded by request on English forum)

//PRC_PivotHiLo
//30.08.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

p = 10

period = round(p/2)+1
hh = high[period]
ll = low[period]
countH = 0
countL = 0
for i = 1 to period-1 do
 if high[i]<hh then
  countH=countH+1
 endif
 if low[i]>ll then
  countL=countL+1
 endif
next
for i = period+1 to p+1 do
 if high[i]<hh then
  countH=countH+1
 endif
 if low[i]>ll then
  countL=countL+1
 endif
next

if countH=p then
 pivotH = high[period]
endif
if countL=p then
 pivotL = low[period]
endif

RETURN pivotH, pivotL

 

Download
Filename: PRC_PivotHiLo.itf
Downloads: 557
Nicolas
Nicolas Legend
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

Denis
6 years ago
#

Good evening Nicolas, could you tell me where thae arrows on the chart come from ? I don't see them when I install the indicator on my charts. Many thanks for advance

Nicolas
6 years ago
#

there is no arrow in this indicator.

roos
8 years ago
#

Hi Nicolas, another really helpful bit of code, thank you! Can I ask how you might amend so that the lines on the chart are not connected, ie you just see the horizontal levels and not the vertical change ups. Conscious that you can switch the indicator view to points but I was looking for lines if possible. Thanks vm

diegofe_2000
10 years ago
#

NUEVAMENTE REPITO,  ESTE ES EL MEJOR INDICADOR PARA HACER SISTEMAS DE COMPRA Y VENTA.  NO ES BUENO , ! ES EXCELENTE¡,  UNA VEZ ENCUENTREN LA FORMA DE UTILIZARLO  LOS SISTEMAS QUE HAGAN NO BAJAN DE TENER UN PORCENTAJE DE ACIERTO DE 90 % MINIMO.

GRACIAS NICOLAS

 

Nicolas
10 years ago
#

Si has encontrado una buena manera de usar este indicador, comparte tu experiencia aquí o en un nuevo tema del foro, estaría encantado de discutir sobre ello contigo y creo que mucha otra gente también :)

diegofe_2000
10 years ago
#

Muy buen indicador, lo estoy utilizando en un probacktest y es un excelente filtro para entradas.

tomferre
10 years ago
#

I notice you code so many indicators Nicolas. I'm trying to learn and have fun with the platform.

Thank you for all your contributions I have found them very very useful for my learning as I don't have a programming or mathematical background.

 

 

Derek
10 years ago
#

Thanks a lot for this! That's a valuable lesson for me.

bard
10 years ago
#

thanks for the code
will compare that time with my code

ProRealCode ProRealCode
Loading...