Data#
Wrapper for discretionary strategy inputs. |
|
A class representing data common to a group of instruments. |
|
A class representing a Economic series |
|
A class representing custom datasets. |
|
A class representing a Economic series |
|
Domain in which a |
-
sigtech.framework.instruments.custom_dataset.custom_dataset(schema: str = None, identifiers: Optional[list[sigtech.framework.infra.data_adapter.identifier.Identifier]] = None, fields: Optional[list[str]] = None, data_source: Optional[DataSource] = None, domain: Optional[str] = None, symbology: Optional[str] = 'internal_id', method=None, filter: Optional[FilterExpression] = None, limit: Optional[int] = None, **kwargs)
Return the history timeseries for a custom dataset.
- Parameters:
schema – Schema identifier (optional).
identifiers – List of instrument names (optional).
fields – List of fields (optional).
data_source – Data source (optional).
domain – Domain (optional).
symbology – Symbology (default is
internal_id
).method – Physical access method (optional).
filter – Filter expression (optional).
limit – Limit value (optional).
- Returns:
pandas DataFrame.
-
sigtech.framework.utils.session_data.session_data_parser(session_data: DataFrame, index: DatetimeIndex, trading_sessions: Union[str, list[str], bool] = True, business_days: DatetimeIndex = None) ndarray
Takes session data and a datetime index and produces a boolean array to allow filtering of a time series by just the points in the desired trading session(s). Eg: data[session_data_parser(session_data, data.index)]
- Parameters:
session_data – instrument.group().session_data() for some instrument
index – A timezone-aware UTC pandas DatetimeIndex - eg, instrument.intraday_history().index
trading_sessions – one or more trading session names, from instument.intraday_trading_sessions() or True to default to [‘Trading’, ‘Morning Trading’, ‘Afternoon Trading’, ‘Evening Trading’, ‘Open (to next day)’]
business_days – a daily DatetimeIndex representing the good business days. If supplied, will filter by these dates only. eg, instrument.history_schedule().data_ts()
- Returns:
np.ndarray
-
sigtech.framework.utils.session_data.sessions_df(session_data: DataFrame) DataFrame
Returns a dataframe of session open/close times per day
- Parameters:
session_data – instrument.group().session_data() for some instrument
-
sigtech.framework.utils.session_data.sessions_open_close(session_data: DataFrame, d: date, step_interpolate: bool = False) dict
Get a dictionary of session name to tuple (open datetime, close datetime) given session data and a particular date. If a session crosses midnight, the given date will line up with the closing time. Returned datetimes will be timezone aware, in local time zone.
- Parameters:
session_data – instrument.group().session_data() for some instrument
d – date to query for
step_interpolate – if True use session entries closest to input - relevant for the wings