Skip to main content

Spread

Spread()
Generate trading signals based on a spread strategy. This class implements a spread-based signal generation where long and short positions are determined based on the relationship between two indicators. Method generated by attrs for class Spread.

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 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 spread strategy.