BacktestSignalsRegister
- class qf_lib.backtesting.signals.backtest_signals_register.BacktestSignalsRegister[source]
Bases:
SignalsRegister
In memory implementation of Signals Register.
Methods:
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.
save_signals
(signals)Add the provided signals to the list of all cached signals.
- 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:
- get_signals_for_ticker(ticker: 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: