Skip to content

Synchronizer

QuantConnect.Lean.Engine.DataFeeds.Synchronizer

Bases: Object, ISynchronizer, IDataFeedTimeProvider, IDisposable

Implementation of the ISynchronizer interface which provides the mechanism to stream data to the algorithm

algorithm

algorithm: IAlgorithm

The algorithm instance

This codeEntityType is protected.

subscription_manager

subscription_manager: IDataFeedSubscriptionManager

The subscription manager

This codeEntityType is protected.

subscription_synchronizer

subscription_synchronizer: SubscriptionSynchronizer

The subscription synchronizer

This codeEntityType is protected.

time_slice_factory

time_slice_factory: TimeSliceFactory

The time slice factory

This codeEntityType is protected.

time_provider

time_provider: ITimeProvider

Continuous UTC time provider, only valid for live trading see LiveSynchronizer

frontier_time_provider

frontier_time_provider: ITimeProvider

Time provider which returns current UTC frontier time

dispose

dispose() -> None

Free resources

get_time_provider

get_time_provider() -> ITimeProvider

Gets the ITimeProvider to use. By default this will load the RealTimeProvider for live mode, else SubscriptionFrontierTimeProvider

This codeEntityType is protected.

Returns:

Type Description
ITimeProvider

The ITimeProvider to use.

initialize

initialize(
    algorithm: IAlgorithm,
    data_feed_subscription_manager: IDataFeedSubscriptionManager,
    performance_tracking_tool: PerformanceTrackingTool,
) -> None

Initializes the instance of the Synchronizer class

post_initialize

post_initialize() -> None

Performs additional initialization steps after algorithm initialization

This codeEntityType is protected.

stream_data

stream_data(
    cancellation_token: CancellationToken,
) -> Iterable[TimeSlice]

Returns an enumerable which provides the data to stream to the algorithm