Core functions#

sigtech.framework.signal.library.core.from_ts(ts)

Return a signal from timeseries.

Parameters

ts – Input timeseries.

Returns

Signal object.

sigtech.framework.signal.library.core.z_score(period, centered=True, min_periods=None, ts=None)

Z-score calculation.

Parameters
  • period – Size of the moving window.

  • centered – If set to True, do not consider the rolling mean (default is True).

  • min_periods – Minimum number of observations in window required to have a value.

  • ts – Input timeseries.

sigtech.framework.signal.library.core.vol(*args, ts, factor=252, **kwargs)

Volatility operator.

Parameters
  • ts – pandas Series or DataFrame.

  • factor – Volatility factor (default is 252).

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.core.percentile_score(array)

Compute the percentile rank of a score relative to a list of scores.

Parameters

array – Input array.

Returns

float.

sigtech.framework.signal.library.core.expanding_percentile(ts)

Expand the percentile rank of a timeseries.

Parameters

ts – pandas Series or DataFrame.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.core.z_score_zero_mean(ts, window, min_periods)

Z-score with zero mean calculation.

Parameters
  • ts – Input timeseries.

  • window – Size of the moving window.

  • min_periods – Minimum number of observations in window required to have a value.

Returns

float.

sigtech.framework.signal.library.core.rolling_beta(ts, market_ts, window)

Rolling beta operator.

Parameters
  • ts – pandas Series or Dataframe.

  • market_ts – pandas Series or Dataframe.

  • window – Size of the window.

Returns

pandas Series or DataFrame.

sigtech.framework.signal.library.core.rolling_beta_adjusted_return(ts, market_ts, window, rtn_window=1)

Rolling beta adjusted return.

Parameters
  • ts – pandas Series or Dataframe.

  • market_ts – pandas Series or Dataframe.

  • window – Size of the window.

  • rtn_window – Size of the return window.

Returns

pandas Series or DataFrame.