The prt STD formula is not the appropriate one

Forums ProRealTime English forum ProBuilder support The prt STD formula is not the appropriate one

  • This topic has 21 replies, 6 voices, and was last updated 4 years ago by avatarBard.
Viewing 7 posts - 16 through 22 (of 22 total)
  • #47759

    Thank you juanj, I will try to use them 🙂

    #47783
    #47793

    I also prefer mathematical correctness but in this case I think it finally won’t matter. The difference between STD.S and STD.Pi is so little. But it becomes of course larger the smaller the sample size is.

    Then one can wonder if it is correct at all to use the standard deviation with a shorter period than 20-30.

    I gave it a try and changed the meander bands I coded not long ago which use period of 20. Changing it resulted in really tiny corrections which won’t affect trading I think.

    #47860


    @Jim
    Moto also see: https://www.prorealcode.com/prorealtime-indicators/regression-statistical-bands-log-normal-v2/

    That is one of the best bands indicator I’ ve never tried 😉 Thank you a lot

    #113078

    From ivolatility: https://www.ivolatility.com/help/2.html#hv
    “To calculate a standard deviation, closing stock prices ( ) are observed over different time frames. We calculate standard deviation for the eight most popular terms: n=10, 20, 30, 60, 90, 120, 150, 180 days on a daily basis. Thus historical volatility can be calculated by the following way.

    Return , where Pt is close price on day t.

    Average day-to-day changes over n-day period can be calculated as sum of returns divided on the number of days. 

    Daily historical volatility calculated on the basis of n days is estimated as

    On IVolatility website we provide annualised Historical Volatility which is calculated as HV=HVdaily*sqrt(252) as we assume 252 trading days in a year.

    Note: In denominator we use n-1 instead of n to receive unbiased estimate of general dispersion (a square of a standard deviation). This adjustment is essential if we estimate standard deviation on the basis of a small number of observations.

    Choosing an appropriate period of observation (n) is not easy. More data generally leads to more accuracy; however, Volatility does change over time and data from deep in the past may not be relevant for predicting the future. The best way for further evaluation is to use a term close to the period considered by most investors or traders.”

    The Historical Volatility  values I’ve found on PRT do not match ivolatility website data and are out by a few percent for the current 30 day HV on the daily S&P 500. The PRT HV code we have is:

    The results for the 10 day and 20 day HV however are relatively close ( S&P 500):
    PRT current 10 day HV = 4.23% v’s ivolatility’s 4.25% and for the
    PRT current 20 day HV = 5.39% v’s ivolatility’s 5.31%.

    What I can’t work out is why the result from this above formula works for the 10 and 20 day but for the current 30 day HV it is 4.23% whereas the ivolatility quote is a “massive” 8.54%?

    https://www.optionseducation.org/toolsoptionquotes/historical-and-implied-volatility

    Pls see screenshot for quotes and note what you see result wise today is a one day delayed quote from the Options Educations site, i.e. the Options Education org site quote on Monday 18th is from last Friday 15th Nov.

    So getting back to this std dev summation topic…  to get “Average day-to-day changes over n-day period can be calculated as sum of returns divided on the number of days ” is it necessary to use the “sum” calculations discussed in this thread in the formula I’ve posted?

    What would that code look like as I’d really like to be able to get PRT’s 30 period volatility quote to match the ivolatility quote? Cheers.

    *Pls delete first black image

    #113125

    The results for the 10 day and 20 day HV however are relatively close ( S&P 500): PRT current 10 day HV = 4.23% v’s ivolatility’s 4.25% and for the PRT current 20 day HV = 5.39% v’s ivolatility’s 5.31%.

    Sunday candles? 10 days on PRT is not the same as the 10 trading days data used in other peoples calculations would be my guess.

    #113212

    Cheers, though doesn’t it seems mathmatically improbable that by adding an additional 10 days to the 20 day that it suddenly jumps by 4% difference on the 30 day historical volatility when it was accurate for the 10 and 20 day. I reverse calculated it and you need between a 33 to 34 day PRT HV setting to match the 30 day HV ivolatility result of 8.53%.

    If there was a Sunday issue wouldn’t we need to deduct (Sun)days from PRT to get it to match what I’m assuming is an ivolatility 5 day trading week, rather than add days?

Viewing 7 posts - 16 through 22 (of 22 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login