Skip to content

SubscriptionDataReaderHistoryProvider

QuantConnect.Lean.Engine.HistoricalData.SubscriptionDataReaderHistoryProvider

Bases: SynchronizingHistoryProvider

Provides an implementation of IHistoryProvider that uses BaseData instances to retrieve historical data

data_permission_manager

data_permission_manager: IDataPermissionManager

Manager used to allow or deny access to a requested datasource for specific users

This codeEntityType is protected.

invalid_configuration_detected

invalid_configuration_detected: _EventContainer[
    Callable[
        [Object, InvalidConfigurationDetectedEventArgs], Any
    ],
    Any,
]

Event fired when an invalid configuration has been detected

numerical_precision_limited

numerical_precision_limited: _EventContainer[
    Callable[
        [Object, NumericalPrecisionLimitedEventArgs], Any
    ],
    Any,
]

Event fired when the numerical precision in the factor file has been limited

download_failed

download_failed: _EventContainer[
    Callable[[Object, DownloadFailedEventArgs], Any], Any
]

Event fired when there was an error downloading a remote file

reader_error_detected

reader_error_detected: _EventContainer[
    Callable[[Object, ReaderErrorDetectedEventArgs], Any],
    Any,
]

Event fired when there was an error reading the data

start_date_limited

start_date_limited: _EventContainer[
    Callable[[Object, StartDateLimitedEventArgs], Any], Any
]

Event fired when the start date has been limited

data_point_count

data_point_count: int

Gets the total number of data points emitted by this history provider

MARKET_HOURS

MARKET_HOURS: MarketHoursDatabase = ...

The market hours database

This codeEntityType is protected.

algorithm_settings

algorithm_settings: IAlgorithmSettings

The algorithm settings instance to use

get_history

get_history(
    requests: List[HistoryRequest], slice_time_zone: Any
) -> Iterable[Slice]

Gets the history for the requested securities

Parameters:

Name Type Description Default
requests List[HistoryRequest]

The historical data requests

required
slice_time_zone Any

The time zone used when time stamping the slice instances

required

Returns:

Type Description
Iterable[Slice]

An enumerable of the slices of data covering the span specified in each request.

get_intraday_data_enumerator

get_intraday_data_enumerator(
    raw_data: IEnumerator[BaseData], request: HistoryRequest
) -> IEnumerator[BaseData]

Gets the intraday data enumerator if any

This codeEntityType is protected.

initialize

initialize(
    parameters: HistoryProviderInitializeParameters,
) -> None

Initializes this history provider to work for the specified job

Parameters:

Name Type Description Default
parameters HistoryProviderInitializeParameters

The initialization parameters

required

on_download_failed

on_download_failed(e: DownloadFailedEventArgs) -> None

Event invocator for the download_failed event

This codeEntityType is protected.

Parameters:

Name Type Description Default
e DownloadFailedEventArgs

Event arguments for the download_failed event

required

on_invalid_configuration_detected

on_invalid_configuration_detected(
    e: InvalidConfigurationDetectedEventArgs,
) -> None

Event invocator for the invalid_configuration_detected event

This codeEntityType is protected.

Parameters:

Name Type Description Default
e InvalidConfigurationDetectedEventArgs

Event arguments for the invalid_configuration_detected event

required

on_numerical_precision_limited

on_numerical_precision_limited(
    e: NumericalPrecisionLimitedEventArgs,
) -> None

Event invocator for the numerical_precision_limited event

This codeEntityType is protected.

Parameters:

Name Type Description Default
e NumericalPrecisionLimitedEventArgs

Event arguments for the numerical_precision_limited event

required

on_reader_error_detected

on_reader_error_detected(
    e: ReaderErrorDetectedEventArgs,
) -> None

Event invocator for the reader_error_detected event

This codeEntityType is protected.

Parameters:

Name Type Description Default
e ReaderErrorDetectedEventArgs

Event arguments for the reader_error_detected event

required

on_start_date_limited

on_start_date_limited(e: StartDateLimitedEventArgs) -> None

Event invocator for the start_date_limited event

This codeEntityType is protected.

Parameters:

Name Type Description Default
e StartDateLimitedEventArgs

Event arguments for the start_date_limited event

required

create_slice_enumerable_from_subscriptions

create_slice_enumerable_from_subscriptions(
    subscriptions: List[Subscription], slice_time_zone: Any
) -> Iterable[Slice]

Enumerates the subscriptions into slices

This codeEntityType is protected.

create_subscription

create_subscription(
    request: HistoryRequest, history: List[BaseData]
) -> Subscription

Creates a subscription to process the history request

This codeEntityType is protected.

get_security_exchange

get_security_exchange(
    exchange: SecurityExchange,
    data_type: Type,
    symbol: Union[Symbol, str, BaseContract],
) -> SecurityExchange

Retrieves the appropriate SecurityExchange based on the data type and symbol.

This codeEntityType is protected.

Parameters:

Name Type Description Default
exchange SecurityExchange

The default exchange instance.

required
data_type Type

The type of data being processed.

required
symbol Union[Symbol, str, BaseContract]

The security symbol.

required

Returns:

Type Description
SecurityExchange

The security exchange with appropriate market hours.