# NOT RUN {
instruments.bak <- as.list(FinancialInstrument:::.instrument, all.names=TRUE)
rm_instruments(keep.currencies=FALSE)
currency("USD")
stock("SPY", "USD", description="S&P 500 ETF")
stock("DIA", "USD", description="DJIA ETF")
stock(c("AA", "AXP", "BA", "BAC", "CAT"), "USD", members.of='DJIA')
stock("BMW", currency("EUR"))
find.instrument("ETF")
find.instrument("DJIA")
find.instrument("DJIA", "members.of")
find.instrument("USD")
find.instrument("EUR")
find.instrument("EUR", Symbols=ls_stocks())
find.instrument("USD", "type")
## Can be combined with buildHierachy
buildHierarchy(find.instrument("ETF"), "type", "description")
## Cleanup. restore previous instrument environment
rm_instruments(); rm_currencies()
loadInstruments(instruments.bak)
# }
Run the code above in your browser using DataLab