I know this is sort of basic and should be well addressed, but is there a well defined method to calculate volatility?

This is how I currently do it:

var dailyReturn = ROCP(symbol, 1, Resolution.Daily);

var volitality = STD(symbol, 84).Of(dailyReturn);

I first define a variable called daily return, and calculated 84 days (trading days in 4 months) of standard deviation of it. However it is far from what I manually calculated from the prices. I know the numbers may be not exactly the name (Annualized, not annualized etc.) but the shape of the data curve is totally different. Can anyone confirm if this is the right way to calculate vol in QC? or if there is a better way to do that?

Thank you!

Author