Fixed Income - finflux.bond()#
The bond() class does not require any input.
Functions#
- sovereign_timeseries(display='table', period='5y', start=None, end=None, interval='1d', data='all', maturity='10y', country='US', show=True, save=False)#
- Parameters:
display (str) – Specifies the output format; VALID VALUES:
'json','table','line'period (str) – The duration of the timeseries; VALID VALUES:
'6mo','1y','2y','5y','10y','ytd','max'start (None or str) – Optional start date in
'YYYY-MM-DD'format. Overrides period parameter if both start and end parameters are set.end (None or str) – Optional end date in
'YYYY-MM-DD'format. Overrides period parameter if both start and end parameters are set.interval (str) – Data frequency; VALID VALUES:
'1d','1wk','1mo'data (str) – Type of OHLCV data to retrieve; VALID VALUES:
'open','high','low','close','all'maturity (str) – The maturity of the sovereign bond; VALID VALUES:
'6mo','1y','2y','3y','5y','7y','10y','20y','30y'country (str) – The country for which data is requested inputted as ISO 3166-1 alpha-2 codes; VALID VALUES:
'AU','AT','BH','BD','BE','BR','BG','CA','CL','CN','CO','CI','HR','CY','CZ','DK','EG','FI','FR','DE','GR','HK','HU','IS','IN','ID','IE','IL','IT','JP','KZ','KE','LV','LT','MY','MT','MU','MX','MA','NA','NL','NZ','NG','NO','PK','PE','PH','PL','PT','QA','RO','RU','RS','SG','SK','SI','ZA','KR','ES','LK','SE','CH','TW','TH','TR','UG','UA','GB','US','VN','ZM'show (bool) – Display the chart as an output if
display == 'line'; VALID VALUES:True,Falsesave (bool) – Download the figure as a png if
display == 'line'; VALID VALUES:True,False
- Returns:
A pandas DataFrame, row oriented JSON formatted output, or simple matplotlib graph of an OHLC timeseries of a sovereign bond.
- Source:
Investing.com (investpy)
- bond_candle(period='6mo', start=None, end=None, interval='1d', sma=None, bollinger=None, o_label=True, h_label=True, l_label=True, c_label=True, legend=False, title=True, maturity='10y', country='US', show=True, save=False)#
- Parameters:
period (str) – The duration of the timeseries; VALID VALUES:
'6mo','1y','2y','5y','10y','ytd','max'start (None or str) – Optional start date in
'YYYY-MM-DD'format. Overrides period parameter if both start and end parameters are set.end (None or str) – Optional end date in
'YYYY-MM-DD'format. Overrides period parameter if both start and end parameters are set.interval (str) – Data frequency; VALID VALUES:
'1d','1wk','1mo'sma (None or list) – Optional standard moving average line(s) generation (
len(sma)capped at 5); VALID VALUES:None,list of int >=10 and <=300bollinger (None or list) – Optional bollinger band standard deviation range(s) generation (
len(bollinger)must equallen(sma)); VALID VALUES:Noneorlist of int/float >=0.1 and <=3.0 or Noneo_label (bool) – Optional plot open price label; VALID VALUES:
True,Falseh_label (bool) – Optional plot high price label; VALID VALUES:
True,Falsel_label (bool) – Optional plot low price label; VALID VALUES:
True,Falsec_label (bool) – Optional plot close price label; VALID VALUES:
True,Falselegend (bool) – Optional legend; VALID VALUES:
True,Falsetitle (bool) – Optional title; VALID VALUES:
True,Falsematurity (str) – The maturity of the sovereign bond; VALID VALUES:
'6mo','1y','2y','3y','5y','7y','10y','20y','30y'country (str) – The country for which data is requested inputted as ISO 3166-1 alpha-2 codes; VALID VALUES:
'AU','AT','BH','BD','BE','BR','BG','CA','CL','CN','CO','CI','HR','CY','CZ','DK','EG','FI','FR','DE','GR','HK','HU','IS','IN','ID','IE','IL','IT','JP','KZ','KE','LV','LT','MY','MT','MU','MX','MA','NA','NL','NZ','NG','NO','PK','PE','PH','PL','PT','QA','RO','RU','RS','SG','SK','SI','ZA','KR','ES','LK','SE','CH','TW','TH','TR','UG','UA','GB','US','VN','ZM'show (bool) – Display the chart as an output; VALID VALUES:
True,Falsesave (bool) – Download the figure as a png; VALID VALUES:
True,False
- Returns:
A matplotlib OHLC candlestick chart figure for the specified sovereign bond
- Source:
Investing.com (investpy)
- curve(display='line', country='US', eod_line=True, three_month_line=True, six_month_line=True, show=True, save=False)#
- Parameters:
display (str) – Specifies the output format; VALID VALUES:
'json','table','line'country (str) – The country for which data is requested inputted as ISO 3166-1 alpha-2 codes; VALID VALUES:
'AU','AT','BH','BD','BE','BR','BG','CA','CL','CN','CO','CI','HR','CY','CZ','DK','EG','FI','FR','DE','GR','HK','HU','IS','IN','ID','IE','IL','IT','JP','KZ','KE','LV','LT','MY','MT','MU','MX','MA','NA','NL','NZ','NG','NO','PK','PE','PH','PL','PT','QA','RO','RU','RS','SG','SK','SI','ZA','KR','ES','LK','SE','CH','TW','TH','TR','UG','UA','GB','US','VN','ZM'eod_line (bool) – Optional latest yield curve; VALID VALUES:
True,Falsethree_month_line (bool) – Optional yield curve 3 months ago; VALID VALUES:
True,Falsesix_month_line (bool) – Optional yield curve 6 months ago; VALID VALUES:
True,Falseshow (bool) – Display the chart as an output if
display == 'line'; VALID VALUES:True,Falsesave (bool) – Download the figure as a png if
display == 'line'; VALID VALUES:True,False
- Returns:
The sovereign bond yield curve data, formatted as either a JSON output, a pandas DataFrame, or a matplotlib graph
- Source:
Investing.com (investpy)
- eod(display='json', maturity='10y', country='US')#
- Parameters:
display (str) – Specifies the output format; VALID VALUES:
'json','pretty'maturity (str) – The maturity of the sovereign bond; VALID VALUES:
'6mo','1y','2y','3y','5y','7y','10y','20y','30y'country (str) – The country for which data is requested inputted as ISO 3166-1 alpha-2 codes; VALID VALUES:
'AU','AT','BH','BD','BE','BR','BG','CA','CL','CN','CO','CI','HR','CY','CZ','DK','EG','FI','FR','DE','GR','HK','HU','IS','IN','ID','IE','IL','IT','JP','KZ','KE','LV','LT','MY','MT','MU','MX','MA','NA','NL','NZ','NG','NO','PK','PE','PH','PL','PT','QA','RO','RU','RS','SG','SK','SI','ZA','KR','ES','LK','SE','CH','TW','TH','TR','UG','UA','GB','US','VN','ZM'
- Returns:
A JSON- or string-formatted display of the specified sovereign bond’s latest end-of-day yield.
- Source:
Investing.com (investpy)
- bond_quote(display='json', maturity='10y', country='US')#
- Parameters:
display (str) – Specifies the output format; VALID VALUES:
'json','pretty'maturity (str) – The maturity of the sovereign bond; VALID VALUES:
'6mo','1y','2y','3y','5y','7y','10y','20y','30y'country (str) – The country for which data is requested inputted as ISO 3166-1 alpha-2 codes; VALID VALUES:
'AU','AT','BH','BD','BE','BR','BG','CA','CL','CN','CO','CI','HR','CY','CZ','DK','EG','FI','FR','DE','GR','HK','HU','IS','IN','ID','IE','IL','IT','JP','KZ','KE','LV','LT','MY','MT','MU','MX','MA','NA','NL','NZ','NG','NO','PK','PE','PH','PL','PT','QA','RO','RU','RS','SG','SK','SI','ZA','KR','ES','LK','SE','CH','TW','TH','TR','UG','UA','GB','US','VN','ZM'
- Returns:
The specified sovereign bond’s quote, including TTM high/low, percentage changes over various periods, and SMAs for yield, formatted as either JSON or a string.
- Source:
Investing.com (investpy)
- US_HQM_corporate(display='table', maturity='10y', period='5y', show=True, save=False)#
- Parameters:
display (str) – Specifies the output format; VALID VALUES:
'json','table','line','bar'maturity (str) – The maturity of the US HQM corporate bond; VALID VALUES:
'6mo','1y','2y','3y','5y','7y','10y','20y','30y'period (str) – The duration of the timeseries; VALID VALUES:
'6mo','1y','2y','5y','10y','ytd','max'show (bool) – Display the chart as an output if
display in ('line', 'bar'); VALID VALUES:True,Falsesave (bool) – Download the figure as a png if
display in ('line', 'bar'); VALID VALUES:True,False
- Returns:
A pandas DataFrame or row oriented JSON formatted output of the monthly timeseries of the high quality market (A, AA, AAA credit ratings) corporate bond yield
- Source:
Federal Reserve Economic Data (US Department of Treasury)