Skip to main content

TwinSpread

TwinSpread()
Generate trading signals based on twin spread strategy. This class implements a twin spread-based signal generation where long and short positions are determined based on the relationship between two indicators. As opposed to Spread, both exit condition should be met. For example, both assets should cross their respective threshold at the same time. Method generated by attrs for class TwinSpread.

Ancestors

  • systematica.signals.base.BaseSignal
  • abc.ABC

Static methods

run

run(
    model_output: numpy.ndarray,
    long_entries: float,
    long_exits: float,
    short_entries: float,
    short_exits: float,
    clean: bool = True,
) ‑> systematica.signals.base.Signals
Run the twin spread signal generation. Parameters:
NameTypeDefaultDescription
model_outputtp.Array--The model output containing the spread values.
long_entriesfloat--The threshold for long entry signals.
long_exitsfloat--The threshold for long exit signals.
short_entriesfloat--The threshold for short entry signals.
short_exitsfloat--The threshold for short exit signals.
cleanbooltoTrue Clean signals. Defaults to True.
Returns:
TypeDescription
SignalsThe generated trading signals based on the twin spread strategy.