Momentum functions#

sigtech.framework.signal.library.momentum.ma(window, ts)

Rolling average operator.

Parameters
  • window – Size of the window.

  • ts – Input timeseries.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.momentum.ewma(window, ts)

EWMA operator.

Parameters
  • window – Size of the window.

  • ts – Input timeseries.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.momentum.sigmoid(factor, ts)

Sigmoid operator.

Parameters
  • factor – Factor value.

  • ts – Input timeseries.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.momentum.l1filter(ts, regularization)

L1 filter.

Parameters
  • ts – Input timeseries.

  • regularization – Regularisation value.

Returns

pandas Series.

sigtech.framework.signal.library.momentum.expanding_l1(regularization, min_periods=3, ts=None, **kwargs)

L1 expansion filter.

Parameters
  • regularization – Regularisation value.

  • min_periods – Minimum number of periods (default is 3).

  • ts – Input timeseries.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.momentum.expanding_l1diff(regularization, min_periods=21, ts=None, **kwargs)

L1 difference expansion filter.

Parameters
  • regularization – Regularisation value.

  • min_periods – Minimum number of periods (default is 21).

  • ts – Input timeseries.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.momentum.hpfilter(ts, regularization)

Hodrick-Prescott filter.

Parameters
  • regularization – Regularisation value.

  • ts – Input timeseries.

Returns

pandas Series.

sigtech.framework.signal.library.momentum.expanding_hp(regularization, min_periods=3, ts=None, **kwargs)

Hodrick-Prescott expansion filter.

Parameters
  • regularization – Regularisation value.

  • min_periods – Minimum number of periods (default is 3).

  • ts – Input timeseries.

Returns

pandas Series.

sigtech.framework.signal.library.momentum.ma_cross(ts, short_span, long_span)

Rolling average cross operator.

Parameters
  • ts – Input timeseries.

  • short_span – Size of the short span window.

  • long_span – Size of the long span window.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.momentum.ewma_cross(ts, short_span, long_span)

EWMA cross operator.

Parameters
  • ts – Input timeseries.

  • short_span – Size of the short span window.

  • long_span – Size of the long span window.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.momentum.ewma_cross1(ts, short_span, long_span)

Alternative EWMA cross operator.

Parameters
  • ts – Input timeseries.

  • short_span – Size of the short span window.

  • long_span – Size of the long span window.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.momentum.simple_ma_signal(short_span, long_span, df)

Create a signal based on rolling average cross operator.

Parameters
  • short_span – Size of the short span window.

  • long_span – Size of the long span window.

  • df – Input DataFrame.

Returns

Signal object.

sigtech.framework.signal.library.momentum.rsi(rsi_period, df)

RSI operator.

Parameters
  • rsi_period – Size of window.

  • df – Input DataFrame.

Returns

pandas DataFrame.

sigtech.framework.signal.library.momentum.macd(ts: pandas.core.series.Series, short_window: int = 12, long_window: int = 26) pandas.core.series.Series

Moving Average Convergence Divergence Indicator.

See macd() for details.

Parameters
  • ts – Close price timeseries.

  • short_window – Short moving average periods.

  • long_window – Long moving average periods.

Returns

Series of indicator values.