I have some financial data which contain stock indexes prices per 30 minutes (I also have them in 5 minute intervals but the logic is the same).
I want to calculate the volatility of this data.
I came across this post here :
which claims that the command
egen st=sd(return), by(date)
gets the job done. So I did that, and I have one value of volatility per day, which basically means that all 30 minute prices (of the same day) have the same volatility calculated.
1) So my first question is, is there a way to calculate a volatility for every price, or different volatilities for the same day ("intraday" volatilities for different "intraday" prices) ? Would that even make sense? Could I use something like the squared returns of every 30 minutes as a proxy for high frequency volatility, or not ?
Or is having one value per day the only way? I understand that since you sum up the squares of the differences and all that to calculate the standard deviation, that the answer could be that you have 1 value, cause you need more than one values to calculate the SD in the first place, right? Or not?
2) My second question is, is there some more sophisticated way to calculate the volatility, instead of using the standard deviation? Maybe a GARCH model would make sense? Any other suggestions
Thanks for the clarification in advance guys, seems I am a little bit confused here!