1
$\begingroup$

Using bdh(), I am trying to download historic weekday prices regardless if the weekday is a holiday or not. The default does not return weekday bank holidays. The only option is to return all calendar days.

The override should be Days=W, but I get an error. It would be great if someone could point me into the right direction. Many thanks!

blpConnect()

startdate <- as.Date("1999-01-29")


tickers <-  c("SPX Index","VIX Index")

opt <- c("periodicitySelection"="DAILY","currency"="USD")
overrides.week <- "Days"
names(overrides.week) = "W"

or

overrride.week <- c("Days"="W")

p.d.raw <- bdh(tickers, 
               fields="LAST PRICE",
               start = startdate, 
               end=Sys.Date(), 
               options=opt, 
               override=overrides.week)

gives the error Choice sub-element not found for name 'securityData'.

$\endgroup$
2
$\begingroup$

This was one solution:

option.fields <- c("periodicitySelection", "nonTradingDayFillOption",
                   "nonTradingDayFillMethod", "periodicityAdjustment",
                   "adjustmentFollowDPDF", "currency")

option.values <- c("DAILY", "NON_TRADING_WEEKDAYS", "NIL_VALUE", 
                   "CALENDAR", "TRUE", "USD")

opt <- structure(option.values, names = option.fields)

p.d.raw <- bdh(tickers, 
               fields="LAST PRICE", 
               start=startdate, 
               end=Sys.Date(), 
               options=opt) 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.