Calculating the volatility of stocks