DailyDataHandler
- class qf_lib.backtesting.data_handler.daily_data_handler.DailyDataHandler(data_provider: DataProvider, timer: Timer)[source]
Bases:
DataHandler
Methods:
get_last_available_price
(tickers[, ...])Gets the latest available price for given assets as of end_time.
- get_last_available_price(tickers: Union[Ticker, Sequence[Ticker]], frequency: Optional[Frequency] = None, end_time: Optional[datetime] = None) Union[float, QFSeries] [source]
Gets the latest available price for given assets as of end_time.
- Parameters:
tickers (Ticker, Sequence[Ticker]) – tickers of the securities which prices should be downloaded
frequency (Frequency) – frequency of the data
end_time (datetime) – date which should be used as a base to compute the last available price. The parameter is optional and if not provided, the end_date will point to the current user time.
- Returns:
last_prices series where: - last_prices.name contains a date of current prices, - last_prices.index contains tickers - last_prices.data contains latest available prices for given tickers
- Return type:
float, pandas.Series