prices_gains: Convert Sequence of Prices to Sequence of Gains

Description Usage Arguments Value Examples

View source: R/prices_gains.R

Description

Converts sequence of prices to sequence of gains for one or more investments.

Usage

1
prices_gains(prices)

Arguments

prices

Numeric vector of prices for one investment or data frame with one column for each investment and an optional Date variable.

Value

Numeric vector or data frame.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Load 2017 prices for Netflix and Amazon, and calculate growth of $10k
prices <- load_prices(c("NFLX", "AMZN"), initial = 1000)

# Calculate gains
gains <- prices_gains(prices)

## End(Not run)

vandomed/stocks documentation built on July 22, 2020, 3:25 a.m.