Convert historical and implied volatility study to a scan


Category:
0
0

I have a IV/HV tool I use and curious how to create a scan using this. I would like to know when the HV is above the 80% level on a daily chart. Red line is above the top white line. Find stocks that meet that criteria.

Here is the tools code:

declare lower;

plot IV = ImpVolatility() ;
plot HV = HistoricalVolatility(30) ;
plot HVAnnualHigh = Highest(HV, 252) ;
plot HVAnnualLow = Lowest(HV, 252) ;
plot Level80Pct = HVAnnualLow + (((HVAnnualHigh – HVAnnualLow) / 5) * 4) ;
plot Level60Pct = HVAnnualLow + (((HVAnnualHigh – HVAnnualLow) / 5) * 3) ;
plot Level40Pct = HVAnnualLow + (((HVAnnualHigh – HVAnnualLow) / 5) * 2) ;
plot Level20Pct = HVAnnualLow + ((HVAnnualHigh – HVAnnualLow) / 5) ;

IV.SetDefaultColor(Color.RED);
HV.SetDefaultColor(Color.BLUE);
HVAnnualHigh.SetDefaultColor(Color.BLACK);
Level80Pct.SetDefaultColor(Color.white);
Level60Pct.SetDefaultColor(Color.white);
Level40Pct.SetDefaultColor(Color.white);
Level20Pct.SetDefaultColor(Color.white);
HVAnnualLow.SetDefaultColor(Color.black);

RESOLVED
Marked as spam
Posted by (Questions: 21, Answers: 47)
Asked on June 4, 2019 8:58 am
290 views
0
Private answer

I updated the title of this question to better reflect the context.

You do not need any code to build this scan. You can simply use the condition wizard to build it within a few clicks of the mouse. Screenshots below shows the basic steps.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on June 4, 2019 12:38 pm
0
This helps me find stocks that are greater than 0.8 but I'm looking for the 80% level that is calculated this way: plot HVAnnualHigh = Highest(HV, 252) ; plot HVAnnualLow = Lowest(HV, 252) ; plot Level80Pct = HVAnnualLow + (((HVAnnualHigh – HVAnnualLow) / 5) * 4) ; Find stocks with an IV above that zone. I did mention HV in the first post but I need IV above the HV zone on the chart. Thanks
( at June 5, 2019 9:36 am)
0

Ok, here is the scan for that:

def HV = HistoricalVolatility(30);
def HVAnnualHigh = Highest(HV, 252);
def HVAnnualLow = Lowest(HV, 252);
def Level80Pct = HVAnnualLow + (((HVAnnualHigh – HVAnnualLow) / 5) * 4);
plot scan = HV > Level80Pct;

( at June 5, 2019 11:16 am)