Below is code for my volatility calculation.
rngvol is the number of days the volatility is taken over
volcal is the number of data items
cor1 is the standard deviation over a given range
volatility 1 should be the volatilty result
'Statistical Volatility Calculation 1
rngvol = Worksheets("config").Cells(32, 2)
volcalc = WorksheetFunction.CountA(Sheets("INFO").Range("A:A"))
Do Until Worksheets("info").Cells(rngvol + i + 1, 1).Value = ""
For i = 1 To volcalc - rngvol + 1
cor1 = WorksheetFunction.StDev(INFO.Range(INFO.Cells(2 + i, 4), INFO.Cells(rngvol + i + 1, 4)).Value)
volatility1 = cor1 * Worksheets("config").Cells(38, 2).Value
Worksheets("info").Cells(rngvol + i + 1, 8).Value = volatility1
Next i
Exit Do
Loop
rngvol is the number of days the volatility is taken over
volcal is the number of data items
cor1 is the standard deviation over a given range
volatility 1 should be the volatilty result
'Statistical Volatility Calculation 1
rngvol = Worksheets("config").Cells(32, 2)
volcalc = WorksheetFunction.CountA(Sheets("INFO").Range("A:A"))
Do Until Worksheets("info").Cells(rngvol + i + 1, 1).Value = ""
For i = 1 To volcalc - rngvol + 1
cor1 = WorksheetFunction.StDev(INFO.Range(INFO.Cells(2 + i, 4), INFO.Cells(rngvol + i + 1, 4)).Value)
volatility1 = cor1 * Worksheets("config").Cells(38, 2).Value
Worksheets("info").Cells(rngvol + i + 1, 8).Value = volatility1
Next i
Exit Do
Loop