# How can I calculate the volatility(standard deviation) of a stock price? and/or ROI (return on investment) of a stock?

I'm trying to build my first portfolio, I've already have set out my monetary goals, graded my risk tolerance and determined the asset allocation I wanted to go with. So, now for the next step I need to actually pick the stocks I want to acquire.

I`m going to pick the stocks taking into account all the steps before, therefore, want to match the returns I want with High-medium-or low growth companies.

In order to do the stated before, Im looking for the ROI and Volatilty as indicators of a stock returns, but basically I dont know where can i get this data from and/or calculate it properly with confidence, or even if is the right way to match the returns of your portfolio with the stocks you have to buy.

ROI and volatility should be calculated over a representative period of time, for example 3 or 5 years, depending on data availability. The ROI is simple, for example, over 5 years:-

``````n = number of years = 5

r1 = price on 31st Oct 2012
r2 = price on 31st Oct 2017

annualised return = (((r2/r1)^(1/n))-1)*100 %
``````

For the 5 year annualised volatility you can refer to the ESMA SRRI methodology.

Box 1 (page 3) ``````m = 52 and T = 260 for weekly returns
m = 12 and T = 60 for monthly returns
``````

`m` is the annualisation factor.

Stock volatility calculated from weekly data should not be compared with volatility calculated from monthly data.

Also, for reference: How to Calculate your Portfolio's Rate of Return

Use the Black-Scholes formula. If you know the current price, an options strike price, time until expiration, and risk-free interest rate, then knowing the market price of the option will tell you what the market's estimation of the volatility is. This does rely on a few assumptions, such as Gaussian random walk, but those are reasonable assumptions for most stocks.

You can also get a list of past stock prices, put them in Excel, and ask Excel to calculate the standard deviation with stdev.s(), but that gives you the past volatility. The market's estimate of future volatility is more relevant.

• @Fattie Comments are for suggesting improvements to answers, not for childish ad hominems. Mar 4 '18 at 1:15
• fair enough. :) Note that I certainly wasn't "attacking the poster" (yourself), which would be an ad hominem. And yeah, Black & Scholes are too easy a public target ;) Mar 4 '18 at 3:09

the "how" all depends on your level of computer savvy. Are you an Excel spreadsheet user or can you write in programming languages such as python? Either approach have math functions that make the calculation of ROI and Volatility trivial.

If you're a python coder, then look up "pandas" (http://pandas.pydata.org/) - it handles a lot of the book-keeping and downloading of end of day equities data. With a dozen lines of code, you can compute ROI and volatility.