Description Usage Arguments Details Value Author(s) See Also Examples
Compare the .instrument environments of two files
1 | CompareInstrumentFiles(file1, file2, ...)
|
file1 |
A file containing an instrument environment |
file2 |
Another file containing an instrument environment. If not
provided, |
... |
Arguments to pass to |
This will load two instrument files (created by
saveInstruments
) and find the differences between them. In
addition to returning a list of difference that are found, it will produce
messages indicating the number of instruments that were added, the number of
instruments that were removed, and the number of instruments that are
different.
A list that contains the names of all instruments that were added,
the names of all instruments that were removed, and the changes to all
instruments that were updated (per all.equal.instrument
).
Garrett See
saveInstruments
, all.equal.instrument
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
#backup current .instrument environment
bak <- as.list(FinancialInstrument:::.instrument, all.names=TRUE)
old.wd <- getwd()
tmpdir <- tempdir()
setwd(tmpdir)
rm_instruments(keep=FALSE)
# create some instruments and save
stock(c("SPY", "DIA", "GLD"), currency("USD"))
saveInstruments("MyInstruments1")
# make some changes
rm_stocks("GLD")
stock("QQQ", "USD")
instrument_attr("SPY", "description", "S&P ETF")
saveInstruments("MyInstruments2")
CompareInstrumentFiles("MyInstruments1", "MyInstruments2")
#Clean up
setwd(old.wd)
reloadInstruments(bak)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.