growth_graph: Graph Investment Growth

Description Usage Arguments Details Value Note Author(s) References Examples

Description

Creates graph of investment growth for one or more investments.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
growth.graph(tickers = NULL, ...,
             prices = NULL,
             initial = 10000,
             add.plot = FALSE,
             colors = NULL,
             lty = NULL,
             plot.list = NULL,
             points.list = NULL,
             grid.list = NULL,
             legend.list = NULL,
             pdf.list = NULL,
             bmp.list = NULL,
             jpeg.list = NULL,
             png.list = NULL,
             tiff.list = NULL)

Arguments

tickers

Character vector of ticker symbols.

...

Arguments to pass along with tickers to load.prices function, if you wish to load data on the fly rather than specify prices.

prices

Numeric matrix of prices (daily or otherwise), where each column has prices for a particular investment.

initial

Numeric value indicating what you would like to scale the initial price of each fund to. If set to NULL, actual fund prices are used.

add.plot

If TRUE, data is plotted on current plot frame rather than a new one.

colors

Character string or vector of colors for each investment.

lty

Numeric string or vector of line types for each investment.

plot.list

Optional list of inputs to pass to plot function.

points.list

Optional list of inputs to pass to points function.

grid.list

Optional list of inputs to pass to grid function.

legend.list

Optional list of inputs to pass to legend function.

pdf.list

Optional list of inputs to pass to pdf function. If not NULL, .pdf file is created.

bmp.list

Optional list of inputs to pass to bmp function. If not NULL, .bmp file is created.

jpeg.list

Optional list of inputs to pass to jpeg function. If not NULL, .jpg file is created.

png.list

Optional list of inputs to pass to png function. If not NULL, .png file is created.

tiff.list

Optional list of inputs to pass to tiff function. If not NULL, .tif file is created.

Details

If tickers is specified, it gets passed to load.gains to load historical prices from Yahoo! Finance using the quantmod package [1]. If prices is specified, performance metrics are calculated directly from that information.

Value

In addition to the graph, a list containing the following items: (1) A numeric matrix named prices of prices for each investment; (2) a numeric vector named means of mean gains for each ticker; and (3) a numeric matrix named corr.matrix containing a correlation matrix for gains of each ticker.

Note

NA

Author(s)

Dane R. Van Domelen

References

1. Jeffrey A. Ryan (2016). quantmod: Quantitative Financial Modelling Framework. R package version 0.4-6, https://cran.r-project.org/package=quantmod.

Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.

Examples

1

Example output

Loading required package: rbenchmark
[1] NA

stocks documentation built on May 2, 2019, 5:22 p.m.