Why don't the Historic and Implied Volatility Scales Match?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #112734 quote
    Bard
    Participant
    Master

    Hi,

    Can anyone figure out how to get the historic and implied volatility chart percentages to match the ones on the Options Councils ivolatility chart (pls see S&P 500 images)?

    In August, for example, on ivolatility implied volatility (IV) is higher than historic volatility (HV) until about half way through the month when HV rises above IV. On my version these two HV and IV lines initially never even crossed (pls see my PRT (NO RANK) image), so I amended the code to use Rank and only then can I get the lines to look something like the Options Council ivolatility chart, but then I don’t get the absolute % values like the peak of just over 20% IV in August on the right hand scale (my HV and IV are up near the 80% area because of Rank).

    If I leave the Ranking out of the indicator code, the two IV and HV lines never hit 20% (in August) and in fact never even cross each other (pls see my PRT (NO RANK) image).
    So are the HV and IV codes wrong or how do I get this code to work to either show absolute values like 15% or 20% (like ivolatility does) because without the Ranking code the IV only reaches around 10% and the HV seems to be about 5% too great at 25% when it shoudn’t be more than 20%?

    Cheers!

    //Historical and Implied Volatility Percentages
    
    //Period = 30
    annualVol = 252
    periods = 7
    Price = log(close / close[1])
    sigma = std[period](Price)
    HVol = (sigma * sqrt(annualVol / periods)) * 100
    lowVol = lowest[annualvol](HVol)
    HVrankUp = HVol - lowVol
    maxVol = highest[annualvol](HVol)
    HVrankLow = maxVol - lowVol
    HVR = (HVrankUp / HVrankLow)*100
    
    //Vix Fix (High) Implied Volatility Proxy
    wvf = ((highest[period](close)-low)/(highest[period](close)))*100
    
    //Boundaries
    upper = highest[period](wvf)
    lower = lowest[period](wvf)
     
    wvflev = ((wvf-lower)/(upper-lower))*100
    
    //colours
    r = 255
    g = 190
    b = 0
    
    r1 = 0
    g1 = 100
    b1 = 255
    
    RETURN HVol coloured(r1,g1,b1) as "Historical Volatility", wvflev coloured(r,g,b) style(line,3) as "Williams High IV Vix Fix", HVR coloured(102,255,255) style(line,2) as "Historical Volatility Rank"
    
    SP500-HV-and-IV.png SP500-HV-and-IV.png SP500-NO-RANK-HV-and-IV.png SP500-NO-RANK-HV-and-IV.png SP500-WITH-RANK-HV-and-IV.png.png SP500-WITH-RANK-HV-and-IV.png.png
    #112738 quote
    Bard
    Participant
    Master

    *Edit

    r1 = 102
    g1 = 255
    b1 = 255
    and
    HVR coloured(r1,g1,b1)
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Why don't the Historic and Implied Volatility Scales Match?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Bard @brad Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by Bard
6 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/13/2019
Status: Active
Attachments: 3 files
Logo Logo
Loading...