Description Usage Arguments Value Examples
calculates the price relatives of according asset prices; that is the closing (opening) price at time t divided by the closing (opening) price at time t-1.
1 | get_price_relatives(prices)
|
prices |
Matrix of asset prices, where each column represents an asset. |
Matrix of price relatives
1 2 3 4 5 6 7 | # load stock prices, for more information see quantmod-package
library(quantmod)
getSymbols("SPY", src="yahoo")
# closing prices
prices <- Cl(SPY)
# get price relatives
get_price_relatives(prices)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.