margot.data.features.finance module¶
-
class
margot.data.features.finance.
SimpleReturns
(column: str, *args, **kwargs)¶ Bases:
margot.data.features.BaseFeature
Simple returns are the percent change from yesterdays close to today’s close.
- Parameters
column (str) – The name of a price time series.
-
label
= 'simple_returns'¶
-
feature
(series)¶
-
class
margot.data.features.finance.
LogReturns
(column: str, *args, **kwargs)¶ Bases:
margot.data.features.BaseFeature
Log returns can be summed over time.
- Parameters
column (str) – The name of the price time series.
-
label
= 'log_returns'¶
-
feature
(series)¶
-
class
margot.data.features.finance.
RealisedVolatility
(column: str, *args, **kwargs)¶ Bases:
margot.data.features.BaseFeature
Realised volatility measures the variability of returns over a lookback window.
- Parameters
column (str) – The name of a returns time series.
window (int) – Lookback window in trading days.
- Raises
AttributeError – A lookback window is required.
-
label
= 'realised_vol'¶
-
window
= None¶
-
feature
(series)¶
-
class
margot.data.features.finance.
SimpleMovingAverage
(column: str, *args, **kwargs)¶ Bases:
margot.data.features.BaseFeature
Simple moving average of lookback window.
- Parameters
column (str) – The name of a returns time series.
window (int) – Lookback window in trading days.
-
window
= None¶
-
get_label
()¶
-
feature
(series)¶
-
class
margot.data.features.finance.
UpperBollingerBand
(column: str, *args, **kwargs)¶ Bases:
margot.data.features.BaseFeature
Upper bollinger band with window and standard deviation.
- Parameters
column (str) – The name of a returns time series.
window (int) – lookback in trading days. Defaults to 20
width (float) – width in standard deviations. Defaults to 2.0
-
window
= 20¶
-
width
= 2.0¶
-
label
= 'upper_boll_band'¶
-
feature
(series)¶
-
class
margot.data.features.finance.
LowerBollingerBand
(column: str, *args, **kwargs)¶ Bases:
margot.data.features.BaseFeature
Lower bollinger band of window and standard deviation.
- Parameters
column (str) – The name of a returns time series.
window (int) – lookback in trading days. Defaults to 20
width (float) – width in standard deviations. Defaults to 2.0
-
window
= 20¶
-
width
= 2.0¶
-
label
= 'lower_boll_band'¶
-
feature
(series)¶