New highs/lows count

Is it possible to write a script that will count the number of times a stock has made a new high or low in a given period of time that i can use in a watchlist column. Outside of my ability.

Thanks Peter

Hi Peter,

You would use the HIGHESTHIGH / LOWESTLOW functions with the accumulation function ACC() to add them up. See the example here:

Accumulation Function

Thanks Darren. The script is correct but when I use a show bar to display the script the arrows are incorrect. What do I need to change in the script?

Thanks Peter

H1 = HIGH()>HIGHESTHIGH(BACKTYPE=Bars, BARS=21);
ACC(H1, RANGE=Look Back Period, BACKTYPE=Bars, BARS=21)new high

Hi Peter,

Show Bar arrows are used for true/false conditions only, so you would either need to change them to numbers or make it a true/false formula based on H1 to just show the new highs and not the accumulation.

Capture