Scan using secondary aggregation periods


Category:
0
0

I’m trying to put together a scan from the documentation but I can’t figure it out.  All I really want to do is get the high low and close from the previous week and see is last is close to that point.  I think I have most to fit but can’t seem to get the script right.

 

input timetocheck = week;

 

def c = close;

 

def checkPoint;

checkPoint = (high(period = timetocheck)[1] + low(period = timetocheck)[1] + close(period = timetocheck)[1]) / 5;

 

plot scan;

scan = close between checkPoint * 1.05 and checkPoint *.95;

Marked as spam
Posted by (Questions: 10, Answers: 15)
Asked on April 20, 2020 5:35 pm
84 views
0
Private answer

Sorry but you cannot use secondary aggregation periods in Study Filters. This feature is not supported for scans at all.

So, you can run your scan using the weekly time frame and simply remove the secondary aggregations from your code:

def checkPoint = (high[1] + low[1] + close[1]) / 5;
plot scan = close between checkPoint * 1.05 and checkPoint *.95;

I have no idea why your are dividing by 5 in the first line. But I only changed those elements related to the secondary aggregation period. But you might want to double check that math.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on April 21, 2020 7:25 am