Description Usage Arguments Details Value See Also Examples
Volatility of one or more stock(s) for a given time period.
1 | volatility(tickers, start, end, data)
|
tickers |
List of ticker names of companies. A character vector. |
start |
Start date in the format "yyyy-mm-dd". |
end |
End date in the format "yyyy-mm-dd". |
data |
A |
Volatility of a given stock for a time period is defined as the standard deviation of the returns of that stock in that time period.
A named numeric vector of volatility in percentage with names being the ticker names of the stocks given as input in tickers
.
1 2 3 4 5 6 7 8 9 10 11 12 | data(SnP500Returns)
tckk <- colnames(SnP500Returns)
# volatility of the stock of the company Apple
# for the time period January 1, 2013 - January 31, 2013
volatility("AAPL", start = "2013-01-01",
end = "2013-01-31", data = SnP500Returns)
# volatility of the first three stocks in SnP500Returns
# for the time period January 1, 2013 - January 31, 2013
volatility(tickers = tckk[1:3], start = "2013-01-01",
end = "2013-01-31", data = SnP500Returns)
|
AAPL
3.505336
A AA AAPL
1.139336 1.272002 3.505336
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.