2025, Oct 19 16:00
Fetch future non-settlement dates from Bloomberg with xbbg blp.bds (CALENDAR_NON_SETTLEMENT_DATES)
Get future non-settlement dates from Bloomberg via xbbg blp.bds and CALENDAR_NON_SETTLEMENT_DATES. Use currency tickers and keyword overrides to avoid blanks.
Planning trading systems around non-settlement days is only possible if you can ask Bloomberg for holiday calendars ahead of time. Relying on blp.bdh to “discover” gaps after the fact won’t work. The goal is to pull future non-trading days for a given market using CALENDAR_NON_SETTLEMENT_DATES, and to do it reliably in code.
Problem statement
The intent was to loop through a set of tickers and country codes, then query non-settlement dates for a wider window around a given month. Despite trying multiple tickers and country codes, the result was always an empty DataFrame.
import pandas as pd
import numpy as np
from xbbg import blp
from datetime import datetime, timedelta
inst_map = {
    'SOFRRATE Index': ('USD Curncy', 'US'),
    'BISTTREF Index': ('TRY Curncy', 'TU'), 
    'MUTKCALM Index': ('JPY Curncy','JN'),
    'RUONIA Index': ('RUB Cunrcy','R$'),
    'SIBCSORA Index': ('SGD Curncy','SI'),
    'SONIO/N Index': ('GBP Curncy','GB'),
    'SRFXON3 Index': ('CHF Curncy','SZ'),
    'TTHORON Index': ('TWD Curncy','T+')
}
def slide_month(y: int, m: int, delta: int):
    new_m = m + delta
    new_y = y + (new_m - 1) // 12
    new_m = ((new_m - 1) % 12) + 1
    return new_y, new_m
def collect_blackout_days(y: int, m: int):
    s_y, s_m = slide_month(y, m, -1)
    e_y, e_m = slide_month(y, m, +1)
    s_date = datetime(s_y, s_m, 10).strftime('%Y%m%d')
    e_date = datetime(e_y, e_m, 15).strftime('%Y%m%d')
    days_by_index = {}
    for idx, (_, ctry_code) in inst_map.items():
        try:
            out = blp.bds(
                idx,
                'CALENDAR_NON_SETTLEMENT_DATES',
                [
                    f'SETTLEMENT_CALENDAR_CODE={ctry_code}',
                    f'CALENDAR_START_DATE={s_date}',
                    f'CALENDAR_END_DATE={e_date}'
                ]
            )
            holidays = out.get('calendar_non_settlement_dates', [])
            days_by_index[idx] = holidays
        except Exception as err:
            print(f"Error for {idx} : {err}")
            days_by_index[idx] = []
    return days_by_index
What goes wrong and why
The failure is rooted in how the request is built for blp.bds. First, the working query targets a currency ticker when asking for CALENDAR_NON_SETTLEMENT_DATES. Second, the overrides have to be provided as keyword arguments rather than as a list of strings. There is also an important observation from the library’s source: the third positional argument is not intended to be a list, which explains why passing a list yields empty results. The combination of an unsuitable ticker and an incorrect override format leads to empty DataFrames.
Working approach
The correct call uses a currency ticker with keyword overrides that define the calendar code and the date range. The result is a DataFrame with a holiday_date column, containing dates in yyyy-mm-dd format.
from xbbg import blp
holidays = blp.bds(
    'USD Curncy',
    'CALENDAR_NON_SETTLEMENT_DATES',
    SETTLEMENT_CALENDAR_CODE='FD',
    CALENDAR_START_DATE='20250101',
    CALENDAR_END_DATE='20261231'
)
print(holidays)
N.B. FD is the calendar for the US.
Why this matters
Non-settlement days drive scheduling for pricing runs, cash movements, roll logic, and operational workflows. Asking Bloomberg for the calendar directly—before the dates arrive—lets you align processes, avoid false alarms from missing prints, and keep downstream systems stable.
Takeaways
If you need future trading holidays, query CALENDAR_NON_SETTLEMENT_DATES on the proper security and send overrides as keyword arguments. When debugging an empty DataFrame, verify the function signature and parameter shape against the implementation to ensure you are not passing positional arguments in the wrong format. Once the request is formed correctly, the DataFrame of holiday_date values is ready to plug into your scheduling logic.