Description Usage Arguments Details Value Note Author(s) See Also Examples
Given the names of symbols, merge together Adjusted columns of their xts objects
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | makePriceFrame(Symbols, from = NULL, to = NULL,
prefer = NULL, notional = FALSE, na.omit = TRUE,
subset = NULL, env = .GlobalEnv, silent)
PF(Symbols, from = NULL, to = NULL, prefer = NULL,
notional = FALSE, na.omit = TRUE, subset = NULL,
env = .GlobalEnv, silent)
makeReturnFrame(Symbols, ..., from = NULL, to = NULL,
prefer = NULL, notional = FALSE, na.omit = TRUE,
subset = NULL, env = .GlobalEnv, silent)
RF(Symbols, ..., from = NULL, to = NULL, prefer = NULL,
notional = FALSE, na.omit = TRUE, subset = NULL,
env = .GlobalEnv, silent)
|
Symbols |
character vector of names of xts objects |
from |
include no data before this date/timestamp |
to |
include data through this date/timestamp |
prefer |
column to use. If NULL, the first of the following columns that is found will be used: ‘Adjusted’, ‘Close’, ‘Mid’ |
notional |
Should notional values be returned?
Default is |
na.omit |
Should |
subset |
xts style subsetting argument. (e.g.
"T08:30/T15:00" or "last 10 days") Default is
|
env |
environment in which to look for xts objects |
silent |
silence warnings? (Currently, the only warning message is “Instrument not found, using contract multiplier of 1”) |
... |
arguments to be passed to |
PF
and RF
are aliases.
makePriceFrame
merges the prefer
columns of
several symbols if prefer
is given. Otherwise, it
will use the adjusted column is if it exists, or close,
mid, or price if it does not. (See estAd
).
If notional
is TRUE
and any Symbols
are the names of
instrument
s, prices
will be multiplied by their multipliers unless they have
a "notional"
attr
that has a value of
TRUE
(which indicates that they have already been
notionalized. If the object has already been
notionalized, and notional
is TRUE
, it will
be used as is. However, if it has already been
notionalized (i.e. isTRUE(attr(obj, 'notional'))
)
and the notional
argument is FALSE
, price
will be divided by their multipliers to "denotionalize"
them.
makeReturnFrame
first calls makePriceFrame
,
then calculates returns on those price series
The from
and to
arguments are intended to
be used to indicate the starting and ending date, whereas
the subset
argument is intended to be used to
subset intraday data by time of day.
Since this function merges together the same
prefer
column from each Symbol, the column names
can be simplified. The colnames
will simply be
set to be the same as Symbols
. A "prefer"
attr
will be added to the returned object so that
you can see (using str
, or attr(x,
"prefer")
) what column was used to build the PriceFrame.
xts object with same number of columns as length of
Symbols
, 1 for each symbol's [adjusted] prices
(returns). The object will have a "prefer" attr
indicating which column was used to build it.
makeReturnFrame
can be useful before calling
functions like charts.PerformanceSummary from the
PortfolioAnalytics package.
Garrett See
estAd
, getPrice
,
attr
, gsa
,
alignSymbols
, merge, cbind
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.