Calculate Historical Stock Volatility

Stock volatility is just a numerical indication of how variable the price of a specific stock is. However, stock volatility is often misunderstood. Some think it refers to risk involved in owning a particular company's stock. Some assume it refers to the uncertainty inherent in owning a stock. Neither is the case. For investors it represents an important measure of how desirable it is to own a certain stock, based on the investor's appetite for risk and reward. Here's how to calculate stock volatility.

Steps

Calculating Stock Returns

  1. Determine a period in which to measure returns. The period is the timeframe in which your stock price varies. This can be daily, monthly, or even yearly. However, daily periods are most commonly used.[1]
  2. Choose a number of periods. The number of periods, n, represents how many periods you will be measuring within your calculation. If you are calculating daily periods, a common number of periods is 21, the average number of trading days in a month. A smaller value would not give you very good results. In fact, the larger the value, the smoother your result becomes.[2]
    • You can also use 63 periods to represent the number of trading days in three months or 252 periods to represent the average number of trading days in a year.[1]
  3. Locate closing price information. The prices you will use to calculate volatility are the closing prices of the stock at the ends of your chosen periods. For example, for daily periods these would be the closing price on that day. Market data can be found, and in some cases downloaded, from market-tracking websites like Yahoo! Finance and MarketWatch.[2]
  4. Calculate returns. The return of a stock in a given period can be defined as the natural log, ln, of the closing price of a stock at the end of the period divided by the closing price of the stock at the end of the previous period. In equation form, this is: Rn=ln(Cn/(C(n-1)), where Rn is the return of a given stock over the period, ln is the natural log function, Cn is the closing price at the end of the period, and C(n-1) is the closing price at the end of the last period.[2]
    • On many calculators, the natural log key is simply "ln" and must be pressed after the rest of the equation has already been calculated.
    • For example, to find the returns when the price closed on one day at $11 and had closed at $10 the day before, you would set up your equation as Rn=ln($11/$10). This would simplify to Rn=ln(1.1). Pressing the ln key to solve gives a result of about 0.0953.
    • The natural log is used to convert the numerical change in value of the stock over the period to an approximation of the percent change between days.[3]

Calculating Stock Volatility

  1. Find the mean return. Take all of your calculated returns and add them together. Then, divide by the number of returns you are using, n, to find the mean return. This represents the average return over the time period you are measuring. Specifically, the mean, m, is calculated as follows: m =(R1+R2+...Rn)/(n).[2]
    • For example, imagine that you had 5 periods that had calculated returns of 0.2, -0.1, -0.3, 0.4, and 0.1. You would add these together to get 0.3 then divide by the number of periods, n, which is 5. Therefore, your mean, m, would be 0.3/5, or 0.06.
  2. Calculate the deviations from the mean. For every return, Rn, a deviation, Dn, from the mean return, m, can be found. The equation for finding Dn can be expressed simply as Dn=Rn-m. Complete this calculation for all returns within the range you are measuring.[1]
    • Using the previous example, you would subtract your mean, 0.06, from each of the returns to get a deviation for each. These would be:
    • D1=0.2-0.06, or 0.14
    • D2=-0.1-0.06, or -0.16
    • D3=-0.3-0.06, or -0.36
    • D4=0.4-0.06, or 0.34
    • D5=0.1-0.06, or 0.04
  3. Find the variance. Your next step is to find the mean variance of the returns by summing the squared individual deviations from the mean of the returns. The equation for finding the variance, S, can be expressed as: S=(D1^2+D2^2+...Dn^2)/(n-1). Again, sum the squares of the deviations, Dn, and divide by the total number of variances minus 1, n-1, to get your mean variance.[2]
    • First, square your deviations from the last step. These would be, in order: 0.0196, 0.0256, 0.1296, 0.1156, 0.0016.
    • Sum these numbers to get 0.292.
    • Then, divide by n-1, which is 4, to get 0.073. So, S=0.073 in the example.
  4. Calculate the volatility. The volatility is calculated as the square root of the variance, S. This can be calculated as V=sqrt(S). This "square root" measures the deviation of a set of returns (perhaps daily, weekly or monthly returns) from their mean. It is also called the Root Mean Square, or RMS, of the deviations from the mean return. It is also called the standard deviation of the returns.[1]
    • In the example, this would just be the square root of S, which is 0.073. So, V=0.270.
      • This number has been rounded to three decimal places. You may choose to keep more decimals to be more accurate.
    • A stock whose price varies wildly (meaning a wide variation in returns) will have a large volatility compared to a stock whose returns have a small variation.
    • By way of comparison, for money in a bank account with a fixed interest rate, every return equals the mean (i.e., there's no deviation) and the volatility is 0.

Finding Volatility Using Excel

  1. Set up your spreadsheet. Calculating volatility is much simpler and faster in Excel than it is by hand. Start by opening Microsoft Excel on your computer and opening a blank worksheet.
  2. Input market information. The next step is to import the closing prices for the stock you are measuring. Input the closing prices vertically in the A column, with the oldest price first and the most recent price at the bottom. For example, 21 days' worth of prices would go in cells A1-A21.[4]
  3. Calculate interday returns. Interday returns are simply the difference between the closing prices of consecutive days. The results of this calculation will go in the cells adjacent to the closing prices, in column B. Calculate these returns by entering the following formula in cell B2: =(A2/A1)-1. This will calculate the percent changes between day 1 and day 2 of your range. Then, drag the formula down the rest of your range to the last price. You should now have a list of interday returns in column B.[4]
  4. Use the standard deviation function. To calculate volatility, all you have to do now is use the standard deviation function. In a nearby cell (it doesn't matter where, as long as it's empty) enter the following function: "=StdDev(". Then, fill in the parentheses with your interday return data from column B. For example, if your data is contained in cells B2 to B21, enter: =StdDev(B2:21). Remember to close the parentheses. Pressing enter on the cell containing this function will give you the volatility of the stock over your chosen time range.[5]

Related Articles

Sources and Citations

You may like