How to compute historical volatility ?

Discussion in 'Options' started by Sekiyo, Jun 17, 2025 at 8:00 AM.

  1. Sekiyo

    Sekiyo

    What formula do you use to compute HV ?

    I use ...

    lookback = 21
    pct_change = log(close/close[1])
    pct_change_ema = ema(pct_change, lookback)
    difference = pct_change - pct_change_ema
    variance = ema(difference^2, lookback)
    stdDev = sqrt(variance)

    How could I improve it ?

    I understood that stdDev is around the mean ...
    Therefore if the mean is 1% and the stdDev is ± 2%,
    Then we expect (1+mean) * exp(1%) and (1+mean) * exp(-1%).

    Or 1.03 and 0.99 ...

    Therefore... if the future realized volatility (pct_change) is 2% / -2% then it will decrease / increase the stdDev. Even if both instances are equal to the stdDev because it's relative to the pct_change_ema which currently is 1%.

    The difference will be 1% and -3%.

    Thanks.
     
    Last edited: Jun 17, 2025 at 8:31 AM
  2. Sekiyo

    Sekiyo

    Maybe you don't care much about HV ?
    Option traders trade IV ... not HV.
     
    Last edited: Jun 17, 2025 at 9:21 AM
  3. How does HV formula handles big earning move? I your case of 21 lookback sample, it will skew on the value for next 20 days, right?
     
    Sekiyo likes this.
  4. Sekiyo

    Sekiyo

    Yes, exponentially weighted 21 (trading) days.

    That's right this HV will underestimate pre-events and overestimate post-events volatility.

    But earnings are known in advance and stdDev could be adjusted accordingly.

    Maybe ... XYZ volatility on the last 4 releases has been, on average, 3 times the HV ...

    But I did look at earnings a little and usually IV is the best estimate of earnings volatility.
     
    Last edited: Jun 17, 2025 at 9:19 AM
  5. Matt_ORATS

    Matt_ORATS Sponsor

    We present a Parkinson modified model at ORATS. When I ran a market making shop we simulated HV by trading gamma on tick data and converting that profit into a volatility. That way was good because it mimicked what we were doing on the floor and our P&L from hedging vs theta. The downside was the computational load and data expense to get the right scalps. Parkinson was the closest vol to those vols.
     
    Sekiyo and spy like this.
  6. spy

    spy

    Swapping it for a time series forecast method. E.G. something based on FFT/wavelets or *ARCH.

    Just guessing... I don't trade.
     
    taowave and Sekiyo like this.

  7. Obv. FFT is worthless for HV.
     
    Sekiyo likes this.
  8. spy

    spy

    I don't trade so IDK. Never made a single $ in my life.
    Becky becky becky! I love you!

    [​IMG]
     

  9. I was referring to post earnings period...while the one time large % change is still in DB
     
    Sekiyo likes this.
  10. lol Neanderthal AI, please inform us as to the utility of FFT for modeling HV!