BacktestSignalsRegister¶
-
class
qf_lib.backtesting.signals.backtest_signals_register.
BacktestSignalsRegister
[source]¶ Bases:
qf_lib.backtesting.signals.signals_register.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
() → qf_lib.containers.dataframe.qf_dataframe.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: qf_lib.common.tickers.tickers.Ticker, alpha_model=None) → qf_lib.containers.series.qf_series.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
-
save_signals
(signals: List[qf_lib.backtesting.signals.signal.Signal])[source]¶ Add the provided signals to the list of all cached signals.
-