SignalsRegister

class qf_lib.backtesting.signals.signals_register.SignalsRegister[source]

Bases: object

Used to save signals processed by the Position Sizer and to be able to later to analyze all signals generated by the model and to present them in a readable form.

Methods:

get_signals()

Returns a QFDataFrame with all generated signals.

get_signals_for_ticker(ticker[, alpha_model])

Returns a QFSeries with all generated signals for the given ticker.

abstract get_signals() QFDataFrame[source]

Returns a QFDataFrame with all generated signals. The columns names consist of ticker names (in the following form: NameOfTicker@Model) and the rows are indexed by the time of signals generation (Signal objects do not store the timestamp).

Returns:

QFDataFrame with all generated signals

Return type:

QFDataFrame

abstract get_signals_for_ticker(ticker: Optional[Ticker], alpha_model=None) QFSeries[source]

Returns a QFSeries with all generated signals for the given ticker. In case of a future ticker, it returns signals that were generated for any specific ticker, that belongs to the futures chain.

Parameters:
  • ticker (Ticker) – ticker for which the data frame should be generated

  • alpha_model – alpha model for which the generated signals should be returned (it checks whether the name of the alpha model matches the one in the signals using the str function)

Returns:

QFDataFrame with all generated signals

Return type:

QFDataFrame