Highest high in the last 500 bars

#1
I want to put an arrow on top of the bar that has the highest high in the last 500 bars. only one bar should be marked. The below code returns many bars.
Code:
PlotShapes( shapeDownTriangle*IIf(HHVBars(High,500)==0, 1, 0 ), colorGreen, 0, H, -30 );
 

mastermind007

Well-Known Member
#2
I want to put an arrow on top of the bar that has the highest high in the last 500 bars. only one bar should be marked. The below code returns many bars.
Code:
PlotShapes( shapeDownTriangle*IIf(HHVBars(High,500)==0, 1, 0 ), colorGreen, 0, H, -30 );
Use condition
HHV(High,500)==High

and get rid of whole IIf.

Even this will show arrows on consecutive candles in rapidly rising market everytime a brand new high is made in 500 candles.

To show one arrow only in every 500 candles, you will either need to some time compression or do a loop scan that goes right to left.
 

KelvinHand

Well-Known Member
#4
Thanks. But this is producing no arrows.

Code:
PlotShapes( shapeDownTriangle*HHV(High,500)==High, colorGreen, 0, H, -30 );
PHP:
PlotShapes( shapeDownTriangle*(HHV(High,500)==High), colorGreen, 0, H, -30 );
Want only one bar should be marked, then do this
mastermind007 Said:
"To show one arrow only in every 500 candles, you will either need to some time compression or do a loop scan that goes right to left."

Simple method to reduce many bars
PHP:
//-- BW Fractal ---
cond = HHV(High,500)==H AND  
        Ref(H, -1) < H AND Ref(H, -2) < Ref(H, -1) AND
        Ref(H, 1)  < H AND Ref(H, 2) < Ref(H, 1) ;
/*
OR

cond = HHV(High,500)==H AND  
        Ref(H, -1) < H AND Ref(H, -2) < H AND
        Ref(H, 1)  < H AND Ref(H, 2) < H ;
*/


PlotShapes( shapeDownTriangle*cond, colorGreen, 0, H, -30 );
Note: Pls don't bother me with reference to the future
 
Last edited:
#5
PHP:
PlotShapes( shapeDownTriangle*(HHV(High,500)==High), colorGreen, 0, H, -30 );
Want only one bar should be marked, then do this



Simple method to reduce many bars
PHP:
//-- BW Fractal ---
cond = HHV(High,500)==H AND  
        Ref(H, -1) < H AND Ref(H, -2) < Ref(H, -1) AND
        Ref(H, 1)  < H AND Ref(H, 2) < Ref(H, 1) ;
/*
OR

cond = HHV(High,500)==H AND  
        Ref(H, -1) < H AND Ref(H, -2) < H AND
        Ref(H, 1)  < H AND Ref(H, 2) < H ;
*/


PlotShapes( shapeDownTriangle*cond, colorGreen, 0, H, -30 );
Note: Pls don't bother me with reference to the future
Sorry this is also not working. Many bars are marked.
 

Similar threads