Wondering if anyone could help out with code for an indicator that tells you the number of bars between 250 day highs?
Many thanks
You mean the count of bars between the last 2 different 250 days highest high?
Hi Nicolas
Yes, highest high or highest close.
Many thanks
This is the code, change “price” variable with either Close or High or anything else 🙂
price = high
hh = highest[250](price)
if hh<>hh[1] then
count=0
else
count=count+1
endif
return count
That’s great Nicolas. Thank you very much.
Hi Nicolas,
Any idea why Prorealtime won’t let me use the indicator as my sorting criteria in a screener? It just puts 255 for every security.
Many thanks
Proscreener has a limitation of 254 bars of history.