Script for Number of new highs over a period not working


Category:
0
0

Hi

I thought I had the count of new highs over a period resolved but my script does not give corrrect answers all the time, and I cannot figure out what could be wrong. I am attaching my code and the dates and high values for the AON for last several days.

Thanks … Ratilal

 

Attachments:
Marked as spam
Posted by (Questions: 4, Answers: 1)
Asked on February 6, 2020 8:26 pm
57 views
0
Private answer

I don't see anything wrong with the counts. I checked a 1 month daily chart and a 3 month daily chart and the counts are correct. The only problem I can find is your first condition is set to zero. So when you have 25 true conditions on the 3 month daily chart the label shows 24. But as I said that is because your code is counting the first occurrence of the condition as zero instead of one.

I have included a screenshot that posts your condition as blue down arrows. You can count them yourself.

Not sure why your code references a daily time frame. Are you using this on an intraday chart and trying to read the counts from the daily time frame? If so, you need to make sure the intraday chart displays the same number of days as the daily chart you are comparing it too. This code cannot read data that is not displayed on the chart.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 7, 2020 9:18 am