MacroEconomicFix#
-
class sigtech.framework.instruments.fixes.MacroEconomicFix
Baseclasses:
HistoricalFrameworkObject
A class representing a macroeconomic fixing.
-
country: str
-
data_provider: str
-
property data_source_all
Data sources of the instrument.
-
description: str
-
property due_time
Required for parent class
- Returns:
None
-
fixing_source: str
-
group_name: str
-
metric: str
-
schedule_start: Optional[date]
-
property timezone: str
Returns the timezone
- Returns:
the timezone identifier as a string
-
unit: str
-
adjustments(frequency: str = 'ALL') list[str]
Returns the available adjustments for the MacroEconomic fix, and optionally frequency
- Parameters:
frequency – The frequency of results to query in
- Returns:
List of the available adjustments
-
data_df(data_point: DataPoint = None, multi_index: bool = False, drop_nan_cols: bool = False, pretty_print=True) DataFrame
Return a DataFrame containing all data available for this object.
- Parameters:
data_point – Optional data point used to load the object history (if applicable).
multi_index – If set to True, rows are uniquely indexed by a multi index (if applicable). Default is False.
drop_nan_cols – If set to True, all-NaN columns are dropped. Default is False.
pretty_print – If set to True, formatting is added to columns names and data values. Rates will be represented as percentage number instead of decimal number (e.g. 3.5 instead of 0.035).
- Returns:
pandas DataFrame.
-
frequencies(adjustment: str = 'ALL') list[str]
Returns the available frequencies present for the MacroEconomic fix and optionally adjustment
- Parameters:
adjustment – The results’ adjustment to query within
- Returns:
List of the available frequencies
-
history(field: str = 'LastPrice', adjust_for_delay: bool = False, date_index: bool = False, data_point: Optional[DataPoint] = None, datetime_index: bool = False) Union[Series, DataFrame]
Method to retrieve time series for objects If the given field does not exist, an empty series will be returned.
- Parameters:
field – Optional - Which revision of a date’s reading to use. Must be one of
adjust_for_delay – Not supported
date_index – Optional - Convert the timestamp index to dates.
data_point – Optional data point, not fully supported
datetime_index – Optional - Add time and UTC timezone to the returned series index
- Returns:
pd.Series
.
-
history_df(fields: list[str] = None, data_point: DataPoint = None, multicolumn: bool = False, revision_version: str = 'last', adjustment: str = 'ALL', frequency: str = 'ALL', metric: str = 'ALL') deprecated
Method to retrieve a
pd.DataFrame
of the historical macroeconomic data.- Parameters:
fields – list of fields. If not supplied, self.history_fields will be used
data_point – optional data point used to load the object history.
multicolumn – If
True
(default) return apd.DataFrame
with columns aspd.MultiIndex
, otherwise, ifFalse
return the samepd.DataFrame
with the columns simply asfields
.revision_version – The revision version to return. Permissible values are ‘last’ (default), ‘first’ and ‘all’ (returns all revisions).
adjustment – The adjustment to return, ‘all’ by default. List available adjustments with .adjustments()
frequency – The frequency to return, ‘all’ by default. List available frequencies with .frequencies()
metric – The metric to return, ‘all’ by default. List available metrics with .metrics()
- Returns:
pd.DataFrame
.
-
holidays()
Returns the name of the holiday calendar associated with this Fix
- Returns:
The name of the holiday calendar
-
macro(field: str = 'value', date_index: bool = False, revision_version: str = 'last', adjustment: str = 'ALL', frequency: str = 'ALL', return_df: bool = True, metric: str = 'ALL') deprecated
Method to retrieve a
pd.DataFrame
of the macro data.- Parameters:
field – Optional - Field to return, ‘lastPrice’ by default
date_index – Optional - Convert the timestamp index to dates.
revision_version – The revision version to return. Permissible values are ‘last’ (default), ‘first’ and ‘all’ (returns all revisions)
adjustment – The adjustment to return, ‘all’ by default. List available adjustments with .adjustments()
frequency – The frequency to return, ‘all’ by default. List available frequencies with .frequencies()
metric – The metric to return, ‘all’ by default. List available metrics with .metrics()
return_df – Whether to return a
pd.DataFrame
orpd.Series
object. True (pd.DataFrame) by default.
- Returns:
pd.DataFrame
by default,pd.Series
optionally
-
metrics(frequency: str = 'ALL', adjustment: str = 'ALL') list[str]
Returns the available metrics present for the MacroEconomic fix
- Parameters:
frequency – The frequency of results to query in
adjustment – The results’ adjustment to query in
- Returns:
List of the available metrics
-
schedule_builder(start, end, frequency: str = 'ALL', adjustment: str = 'ALL')
Builds the schedule of days on which data was released, for all datapoints held, and returns it
- Parameters:
start – Unused
end – Unused
frequency – Frequency of the fix
adjustment – Adjustment of the fix
- Returns:
Schedule object