daily_yearly: Convert Daily Gain to X-year Gain

Description Usage Arguments Value Examples

View source: R/daily_yearly.R

Description

For example, you can use this function to calculate that an investment that gains 0.1% each day would gain approximately 28.5% in a year (252 trading days).

Usage

1
daily_yearly(gain, years = 1)

Arguments

gain

Numeric vector specifying each gain to convert, e.g. 0.001 for 0.1%.

years

Numeric value.

Value

Numeric value or vector.

Examples

1
2
3
4
5
# Calculate annual gain for an investment that gains 0.1% per day
daily_yearly(gain = 0.001)

# Calculate 5-year gains corresponding to various daily gains
daily_yearly(gain = seq(0, 0.001, 0.0001), years = 5)

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