alpheast.handlers.data_handler module

class alpheast.handlers.data_handler.DataHandler(event_queue, symbols, start_date, end_date, interval, data_source)[source]

Bases: object

A concrete data handler that fetches price data from the database via DatabaseDataRepository for a specified interval. Also pushes DailyUpdateEvents.

stream_next_market_event()[source]

Retrieves the next price bar(s), creates a MarketEvent and puts it onto the queue. Also pushes a DailyUpdateEvent when a new day begins. This function will now stream all events for a single timestamp in one go.

continue_backtest()[source]
Return type:

bool

reset()[source]

Resets the DataHandler to its initial state, ready to stream data from the beginning.