Optuma Forums › Optuma Scripting › Pocket pivot scan › Reply To: Pocket pivot scan
March 14, 2022 at 8:58 am
#67677
- Topics: 5
- Replies: 609
- Posts: 614
Hi,
We do not need to manually set the criteria for each bar, we can use HighestHigh() and ACC() to do that for us.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
//Set Volume V1 = VOLUME() ; //Set Down Days V2 = CLOSE() < OPEN() ; //Set Volume when a day is down V3 = IF(V2==1,V1,0); //Find the highest volume value from a down day over the last 10 days V4 = HIGHESTHIGH(V3, BARS=10) ; //Find where the current bar is up and the volume is higher than V4 V5 = V1 >= V4 and V2 == 0; //Count how often V5 was true in the last 10 days V6 = ACC(V5, RANGE=Look Back Period, BARS=10) ; //Show results where V5 was true 3 or more times in the last 10 days V6 >= 3 |
Here is how it looks on the chart:
Example workbook attached.