quantlab.dataset.config.FredRateConfig#
- class quantlab.dataset.config.FredRateConfig(*, zarr_file_path, start_date=None, end_date=None, symbols=None, kwargs=None, resample_freq=None, resample_how=None, name=None, raw_data_dir_path, market='us_equity', frequency='1d', vendor='fred', series='DTB3', days_per_year=252)[source]#
Bases:
DatasetConfigConfig of a single-symbol panel of one FRED interest-rate series.
raw_data_dir_pathis the FRED raw tier thatFredAcquisitionwrites; the panel’s one symbol is the series id. The series must be quoted in annualized percent, as the Treasury bill rates are.Examples
>>> cfg = FredRateConfig( ... zarr_file_path="/data/zarrs/fred_dtb3_1d.zarr", ... raw_data_dir_path="/data/downloads/us_equity/1d/macro/fred", ... ) >>> cfg.series, cfg.days_per_year, cfg.vendor ('DTB3', 252, 'fred')
- days_per_year = 252#
Days per year the annual rate is divided by to give the per-bar
risk_freereturn:rate / 100 / days_per_year. The default, 252 trading days, is our choice; it makes the per-bar rate a rate per trading day, the bar of a daily price panel.
- frequency = '1d'#
FRED’s Treasury bill rates are daily.
- market = 'us_equity'#
The rate’s market is the one whose returns it is subtracted from.
- series = 'DTB3'#
FRED series id: the default, DTB3, is the 3-month Treasury bill secondary market rate, discount basis, annualized percent.
- vendor = 'fred'#
Always FRED.