Requesting Weekday Holiday Dates in Bloomberg Historical Data
Summary
The question concerns retrieving daily historical prices for every weekday, including weekdays when the relevant market is closed, using the Bloomberg R interface’s historical data function. The asker attempts to use a weekday override and receives an error. The response offers a different configuration: set the non-trading-day fill option to include non-trading weekdays, specify a fill method that returns no value, and provide daily periodicity and calendar adjustment settings alongside the currency option.
The example is intended to address weekday calendar coverage without requesting every calendar day. It demonstrates how non-trading-day behavior can be controlled through the function’s options rather than the attempted override. The discussion supplies a single solution and no comparison with other settings, no returned data example, and no confirmation across instruments or library versions. Users should therefore treat it as a targeted configuration answer and check that the selected fill and adjustment behavior matches their data needs.
Key ideas
- Daily historical requests can include non-trading weekdays through the non-trading-day fill option.
- The response configures the request through named options rather than the attempted weekday override.
- The proposed settings use a no-value fill method for included non-trading weekdays.
- The example does not compare alternatives or establish behavior across all instruments and software versions.
Tags
Full text
# Rblpapi / bdh - how to download prices for all weekdays - regardless if it is a bank holiday
# Rblpapi / bdh - how to download prices for all weekdays - regardless if it is a bank holiday
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'.
## Answer by Researcher (score 2)
https://quant.stackexchange.com/a/22749
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)
```Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.