get_price_relatives: Get price relatives

Description Usage Arguments Value Examples

Description

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.

Usage

1

Arguments

prices

Matrix of asset prices, where each column represents an asset.

Value

Matrix of price relatives

Examples

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)

ngloe/olpsR documentation built on May 23, 2019, 4:42 p.m.