First, you have an error in the countLL function - you'll want to change ">" to "<".
Next, what is your definition of highest-highs in a period? Is it when the high is higher than the previous high, or is it when a new record is set? It seems you are doing the former and not the latter.