Recursive Count on Daily Chart only seems to count from YTD period.


Category:
0
0

Hi,

When I plot the value closedLow I count about 16 entries manually. I want a script to count this

My code is below and it seems to only count from YTD ie. all the bars from beginning of the year why is that?

def closedLow = (high >= close[1] * 1.25) && (((close – low) / (high – low)) <= (25/ 100));

def totalClosedLow = if(isnan(totalClosedLow[1])) then 1 else if (closedLow) then totalClosedLow[1] + 1 else totalClosedLow[1];

 

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on March 31, 2019 6:14 am
117 views
0
Private answer

Without seeing a screenshot of your chart I cannot tell for sure. However your code is likely being restricted based on the way you have set the time frame. The daily chart is set to default 1 year of daily candles. You can increase that to 2, 3, or more years of daily candles. This should change the results you are getting. But since you state that you are only getting YTD, I am not sure. So you are saying the results returned are only covering the months of Jan, Feb, March and Apr of 2019?

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 6, 2019 9:42 am