Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer Class Reference

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

Inheritance diagram for QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer:
[legend]

Public Member Functions

override void Initialize (IAlgorithm algorithm, IDataFeedSubscriptionManager dataFeedSubscriptionManager)
 Initializes the instance of the Synchronizer class More...
 
override IEnumerable< TimeSliceStreamData (CancellationToken cancellationToken)
 Returns an enumerable which provides the data to stream to the algorithm More...
 
override void Dispose ()
 Free resources More...
 

Public Attributes

override ITimeProvider TimeProvider => _timeProvider
 Continuous UTC time provider More...
 
- Public Attributes inherited from QuantConnect.Lean.Engine.DataFeeds.Synchronizer
virtual ITimeProvider TimeProvider => null
 Continuous UTC time provider, only valid for live trading see LiveSynchronizer More...
 
ITimeProvider FrontierTimeProvider => SubscriptionSynchronizer
 Time provider which returns current UTC frontier time More...
 

Static Public Attributes

static readonly int BatchingDelay = Config.GetInt("consumer-batching-timeout-ms")
 Consumer batching timeout in ms More...
 

Protected Member Functions

override ITimeProvider GetTimeProvider ()
 Gets the ITimeProvider to use. By default this will load the RealTimeProvider for live mode, else SubscriptionFrontierTimeProvider More...
 
override void PostInitialize ()
 Performs additional initialization steps after algorithm initialization More...
 
virtual int GetPulseDueTime (DateTime now)
 Will return the amount of milliseconds that are missing for the next time pulse More...
 
virtual void OnSubscriptionNewDataAvailable (object sender, EventArgs args)
 Trigger new data event More...
 

Additional Inherited Members

- Properties inherited from QuantConnect.Lean.Engine.DataFeeds.Synchronizer
IAlgorithm Algorithm [get, set]
 The algorithm instance More...
 
IDataFeedSubscriptionManager SubscriptionManager [get, set]
 The subscription manager More...
 
SubscriptionSynchronizer SubscriptionSynchronizer [get, set]
 The subscription synchronizer More...
 
TimeSliceFactory TimeSliceFactory [get, set]
 The time slice factory More...
 
- Properties inherited from QuantConnect.Lean.Engine.DataFeeds.IDataFeedTimeProvider
ITimeProvider TimeProvider [get]
 Continuous UTC time provider More...
 
ITimeProvider FrontierTimeProvider [get]
 Time provider which returns current UTC frontier time More...
 

Detailed Description

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

Definition at line 31 of file LiveSynchronizer.cs.

Member Function Documentation

◆ Initialize()

override void QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.Initialize ( IAlgorithm  algorithm,
IDataFeedSubscriptionManager  dataFeedSubscriptionManager 
)
virtual

Initializes the instance of the Synchronizer class

Reimplemented from QuantConnect.Lean.Engine.DataFeeds.Synchronizer.

Definition at line 51 of file LiveSynchronizer.cs.

Here is the call graph for this function:

◆ StreamData()

override IEnumerable<TimeSlice> QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.StreamData ( CancellationToken  cancellationToken)
virtual

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

Reimplemented from QuantConnect.Lean.Engine.DataFeeds.Synchronizer.

Definition at line 84 of file LiveSynchronizer.cs.

Here is the call graph for this function:

◆ Dispose()

override void QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.Dispose ( )
virtual

Free resources

Reimplemented from QuantConnect.Lean.Engine.DataFeeds.Synchronizer.

Definition at line 185 of file LiveSynchronizer.cs.

◆ GetTimeProvider()

override ITimeProvider QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.GetTimeProvider ( )
protectedvirtual

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

Returns
The ITimeProvider to use

Reimplemented from QuantConnect.Lean.Engine.DataFeeds.Synchronizer.

Definition at line 197 of file LiveSynchronizer.cs.

Here is the caller graph for this function:

◆ PostInitialize()

override void QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.PostInitialize ( )
protectedvirtual

Performs additional initialization steps after algorithm initialization

Reimplemented from QuantConnect.Lean.Engine.DataFeeds.Synchronizer.

Definition at line 205 of file LiveSynchronizer.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPulseDueTime()

virtual int QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.GetPulseDueTime ( DateTime  now)
protectedvirtual

Will return the amount of milliseconds that are missing for the next time pulse

Definition at line 214 of file LiveSynchronizer.cs.

Here is the caller graph for this function:

◆ OnSubscriptionNewDataAvailable()

virtual void QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.OnSubscriptionNewDataAvailable ( object  sender,
EventArgs  args 
)
protectedvirtual

Trigger new data event

Parameters
senderSender of the event
argsEvent information

Definition at line 225 of file LiveSynchronizer.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ BatchingDelay

readonly int QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.BatchingDelay = Config.GetInt("consumer-batching-timeout-ms")
static

Consumer batching timeout in ms

Definition at line 36 of file LiveSynchronizer.cs.

◆ TimeProvider

override ITimeProvider QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.TimeProvider => _timeProvider

Continuous UTC time provider

Definition at line 46 of file LiveSynchronizer.cs.


The documentation for this class was generated from the following file: