- Topics: 5
- Replies: 292
- Posts: 297
I think what you’re after is possible with a script. I’ve included some sample code below and have attached a workbook using the S&P100 constituents to try it on.
//Set Measure Points
V1 = OPEN() ;
V1a = HIGH() ;
V2 = HIGH(1) ;
V2a = LOW(1) ;
//Look for Gaps where Open and Low of current bar is higher than previous bars high
V3 = V1 > V2 and LOW() > V2;
//Look for Gaps where the Open and High of current bar is lower than previous low
V3a = V1 < V2a and V1a < V2a ;
//Find the percentage difference between the Open and Previous High
V4 = 100 * abs(V2 - V1)/V1 ;
//Find the percentage difference between the Open and the Previous Low
V4a = 100 * abs(V2a- V1)/V1 ;
//Find Percent Value for Gap Up and Down
V5 = IF(V3 == 1,V4,0);
V5a = IF(V3a == 1,V4a,0);
//Find Percent Value for non Gap
V6a = V3a == 0 and V3a == 0;
V6 = IF(V6a == 1,V4,0);
//Accumulate All Values
V7 = ACC(V5);
V7a = ACC(V5a) ;
V8 = ACC(V6);
//Add Gap Up and Gap Down Values together and divide by non gap value to build ratio
(V7a + V7a) / V8
Not sure if it's 100% what you were wanting to do but should point you in the right direction in building your own script.
- This reply was modified 2 weeks, 1 day ago by Matthew.
You must be logged in to access attached files.