# How to calculate stock volatility in %?

How can I calculate the stock volatility in percentage? Do i have to use sd() function without any other calculation ?

Thanks

-

BNaul's answer is probably not the one you're looking for. If you want to calculate Black-Scholes style volatility, you need to calculate an annualized volatility of log-returns. That means, calculate the log return series $\ln(s_t/s_{t-1})$ for each $t$, take the standard deviation, and then adjust it by the square root of time to obtain the annualized figure. This volatility can be used in pricing models that require Black Scholes vol.

-
library(tseries)
price <- data$Close ret <- log(lag(price)) - log(price) vol <- sd(ret) * sqrt(250) * 100  Notes: 1. The above code should really be using prices adjusted for corporate actions (dividends, splits etc). 2. 250 is the (approximate) number of trading days in a year. - add comment When volatility is described as a percentage, that means it's being given as a fraction of the mean. So if the standard deviation of the price is 10 and the mean is 100, then the price could be described as 10% volatile. In R terms, this would mean: vol_percent = sd(price) / mean(price)  EDIT: This could also have been easily found on the Wikipedia article for volatility. - Re the edit: Your answer disagrees with the Wikipedia article: "The annualized volatility σ is the standard deviation of the instrument's yearly logarithmic returns." That's the value appearing in the Block-Scholes and other stochastic models. Multiply it by 100 to express it in percent. – whuber Aug 25 '11 at 19:09 Huh. The definition I was familiar with was the one from the introduction: "Volatility is normally expressed in annualized terms, and it may either be an absolute number ($5) or a fraction of the mean (5%)." I'm not a finance guy by any means, though, so if you or someone else wants to give a more thorough answer then that would be welcome. –  bnaul Aug 25 '11 at 19:30