bond_indices
Bond Indices.
Examples
from openbb import obb
# The default state for FRED are series for constructing the US Corporate Bond Yield Curve.
obb.fixedincome.bond_indices(provider='fred')
# Multiple indices, from within the same 'category', can be requested.
obb.fixedincome.bond_indices(category=high_yield, index=us,europe,emerging, index_type='total_return', provider='fred')
# From FRED, there are three main categories, 'high_yield', 'us', and 'emerging_markets'. Emerging markets is a broad category.
obb.fixedincome.bond_indices(category=emerging_markets, index=corporate,private_sector,public_sector, provider='fred')
Parameters
- standard
- fred
Name | Type | Description | Default | Optional |
---|---|---|---|---|
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
index_type | Literal['yield', 'yield_to_worst', 'total_return', 'oas'] | The type of series. OAS is the option-adjusted spread. Default is yield. | yield | True |
Name | Type | Description | Default | Optional |
---|---|---|---|---|
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
index_type | Literal['yield', 'yield_to_worst', 'total_return', 'oas'] | The type of series. OAS is the option-adjusted spread. Default is yield. | yield | True |
category | Literal['high_yield', 'us', 'emerging_markets'] | The type of index category. Used in conjunction with 'index', default is 'us'. | us | True |
index | Union[str, List[str]] | The specific index to query. Used in conjunction with 'category' and 'index_type', default is 'yield_curve'. Multiple items allowed for provider(s): fred. | yield_curve | True |
frequency | Literal['a', 'q', 'm', 'w', 'd', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem'] | Frequency aggregation to convert daily data to lower frequency. None = No change; a = Annual; q = Quarterly; m = Monthly; w = Weekly; d = Daily; wef = Weekly, Ending Friday; weth = Weekly, Ending Thursday; wew = Weekly, Ending Wednesday; wetu = Weekly, Ending Tuesday; wem = Weekly, Ending Monday; wesu = Weekly, Ending Sunday; wesa = Weekly, Ending Saturday; bwew = Biweekly, Ending Wednesday; bwem = Biweekly, Ending Monday | None | True |
aggregation_method | Literal['avg', 'sum', 'eop'] | A key that indicates the aggregation method used for frequency aggregation. This parameter has no affect if the frequency parameter is not set, default is 'avg'. avg = Average; sum = Sum; eop = End of Period | avg | True |
transform | Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log'] | Transformation type; None = No transformation; chg = Change; ch1 = Change from Year Ago; pch = Percent Change; pc1 = Percent Change from Year Ago; pca = Compounded Annual Rate of Change; cch = Continuously Compounded Rate of Change; cca = Continuously Compounded Annual Rate of Change; log = Natural Log | None | True |
Returns
OBBject
results : List[BondIndices]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra : Dict[str, Any]
Extra info.
Data
- standard
- fred
Name | Type | Description |
---|---|---|
date | Union[date, str] | The date of the data. |
symbol | str | Symbol representing the entity requested in the data. |
value | float | Index values. |
Name | Type | Description |
---|---|---|
date | Union[date, str] | The date of the data. |
symbol | str | Symbol representing the entity requested in the data. |
value | float | Index values. |
maturity | str | The maturity range of the bond index. Only applicable when 'index' is 'yield_curve'. |
title | str | The title of the index. |