# NOT RUN {
bdh("SPY US Equity", c("PX_LAST", "VOLUME"), start.date=Sys.Date()-31)
## example for an options field: request monthly data; see section A.2.4 of
## http://www.bloomberglabs.com/content/uploads/sites/2/2014/07/blpapi-developers-guide-2.54.pdf
## for more
opt <- c("periodicitySelection"="MONTHLY")
bdh("SPY US Equity", c("PX_LAST", "VOLUME"),
start.date=Sys.Date()-31*6, options=opt)
## example for options and overrides
opt <- c("periodicitySelection" = "QUARTERLY")
ovrd <- c("BEST_FPERIOD_OVERRIDE"="1GQ")
bdh("IBM US Equity", "BEST_SALES", start.date=Sys.Date()-365.25*4,
options=opt, overrides=ovrd)
# }
Run the code above in your browser using DataLab