Description Usage Arguments Details Value Note Author(s) References See Also Examples
Create plot showing one performance metric vs. another for several investments.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | twometrics.graph(tickers = NULL, ...,
gains = NULL,
prices = NULL,
x.metric = "mdd",
y.metric = "cagr",
tickerlabel.offsets = NULL,
add.plot = FALSE,
colors = NULL,
plot.list = NULL,
points.list = NULL,
text.list = NULL,
pdf.list = NULL,
bmp.list = NULL,
jpeg.list = NULL,
png.list = NULL,
tiff.list = NULL)
|
tickers |
Character vector of ticker symbols. If |
... |
Arguments to pass along with |
gains |
Numeric matrix of gains (daily or otherwise), where each column has gains for a
particular investment. If |
prices |
Numeric matrix of prices (daily or otherwise), where each column has prices for
a particular investment. If |
x.metric |
Character string specifying what performance metric should be plotted on x-axis.
Possible values are as follows: |
y.metric |
Same as |
tickerlabel.offsets |
Can be any of the following: numeric vector of length 2 giving x-axis and y-axis
offsets for ticker labels on all data points; 2-column matrix where each row
gives x-axis offset and y-axis offset for a particular ticker, following same
order of tickers as in |
add.plot |
If |
colors |
Character string of colors for each fund. |
plot.list |
Optional list of inputs to pass to |
points.list |
Optional list of inputs to pass to |
text.list |
Optional list of inputs to pass to |
pdf.list |
Optional list of inputs to pass to |
bmp.list |
Optional list of inputs to pass to |
jpeg.list |
Optional list of inputs to pass to |
png.list |
Optional list of inputs to pass to |
tiff.list |
Optional list of inputs to pass to |
If tickers
is specified, it gets passed to load.gains
to
load historical prices from Yahoo! Finance using the quantmod package
[1]. If gains
or prices
is specified, the performance metrics are
calculated directly from that information.
In addition to the graph, a data frame containing the tickers and the performance metrics for each ticker.
NA
Dane R. Van Domelen
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.
onemetric.graph
, onemetric.overtime.graph
1 |
Loading required package: rbenchmark
[1] NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.