This issue pertains to attempting to pull historic data (bdh function) for all real days, and setting the way NA values are handled. This filling does work, when all options are set within the options argument, but does not work when some options are set in optionsandinclude.non.trading.days is used. Below is a simple example:
library(Rblpapi)
blpConnect()
# Print 30 real days of data, without backfilling missing values:
bdh("VIX Index", "PX_LAST", start.date = Sys.Date() - 30, include.non.trading.days = TRUE)
# Now, try to use the option to fill NA's with the previous value:
myOptions <- structure(c("PREVIOUS_VALUE"), names = c("nonTradingDayFillMethod"))
# You'll notice, all the NA's remain:
bdh("VIX Index", "PX_LAST", start.date = Sys.Date() - 30, include.non.trading.days = TRUE, options = myOptions)
# Instead of specifying 'include.non.trading.days' in the bdh function, I'll move this directly to the options:
myOptions <- structure(c("PREVIOUS_VALUE", "ALL_CALENDAR_DAYS"), names = c("nonTradingDayFillMethod", "nonTradingDayFillOption"))
# Then, I remove the 'include.non.trading.days' specification from the function, and it works as expected:
bdh("VIX Index", "PX_LAST", start.date = Sys.Date() - 30, options = myOptions)
This most likely ought to be low priority, since there is a fairly straight-forward work-around. Rather, this is more FYI.
This issue pertains to attempting to pull historic data (bdh function) for all real days, and setting the way NA values are handled. This filling does work, when all options are set within the
options
argument, but does not work when some options are set inoptions
andinclude.non.trading.days
is used. Below is a simple example:This most likely ought to be low priority, since there is a fairly straight-forward work-around. Rather, this is more FYI.