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

Subscription data reader is a wrapper on the stream reader class to download, unpack and iterate over a data file. More...

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

Public Member Functions

 SubscriptionDataReader (SubscriptionDataConfig config, BaseDataRequest dataRequest, IMapFileProvider mapFileProvider, IFactorFileProvider factorFileProvider, IDataCacheProvider dataCacheProvider, IDataProvider dataProvider, IObjectStore objectStore)
 Subscription data reader takes a subscription request, loads the type, accepts the data source and enumerate on the results. More...
 
void Initialize ()
 Initializes the SubscriptionDataReader instance More...
 
bool MoveNext ()
 Advances the enumerator to the next element of the collection. More...
 
void Reset ()
 Reset the IEnumeration More...
 
void Dispose ()
 Dispose of the Stream Reader and close out the source stream and file connections. More...
 

Protected Member Functions

virtual void OnInvalidConfigurationDetected (InvalidConfigurationDetectedEventArgs e)
 Event invocator for the InvalidConfigurationDetected event More...
 
virtual void OnNumericalPrecisionLimited (NumericalPrecisionLimitedEventArgs e)
 Event invocator for the NumericalPrecisionLimited event More...
 
virtual void OnStartDateLimited (StartDateLimitedEventArgs e)
 Event invocator for the StartDateLimited event More...
 
virtual void OnDownloadFailed (DownloadFailedEventArgs e)
 Event invocator for the DownloadFailed event More...
 
virtual void OnReaderErrorDetected (ReaderErrorDetectedEventArgs e)
 Event invocator for the ReaderErrorDetected event More...
 
virtual void OnNewTradableDate (NewTradableDateEventArgs e)
 Event invocator for the NewTradableDate event More...
 

Properties

BaseData Current [get]
 Last read BaseData object from this type and source More...
 

Events

EventHandler< InvalidConfigurationDetectedEventArgsInvalidConfigurationDetected
 Event fired when an invalid configuration has been detected More...
 
EventHandler< NumericalPrecisionLimitedEventArgsNumericalPrecisionLimited
 Event fired when the numerical precision in the factor file has been limited More...
 
EventHandler< StartDateLimitedEventArgsStartDateLimited
 Event fired when the start date has been limited More...
 
EventHandler< DownloadFailedEventArgsDownloadFailed
 Event fired when there was an error downloading a remote file More...
 
EventHandler< ReaderErrorDetectedEventArgsReaderErrorDetected
 Event fired when there was an error reading the data More...
 
EventHandler< NewTradableDateEventArgsNewTradableDate
 Event fired when there is a new tradable date More...
 
- Events inherited from QuantConnect.Lean.Engine.DataFeeds.Enumerators.ITradableDatesNotifier
EventHandler< NewTradableDateEventArgsNewTradableDate
 Event fired when there is a new tradable date More...
 
- Events inherited from QuantConnect.Interfaces.IDataProviderEvents
EventHandler< InvalidConfigurationDetectedEventArgsInvalidConfigurationDetected
 Event fired when an invalid configuration has been detected More...
 
EventHandler< NumericalPrecisionLimitedEventArgsNumericalPrecisionLimited
 Event fired when the numerical precision in the factor file has been limited More...
 
EventHandler< DownloadFailedEventArgsDownloadFailed
 Event fired when there was an error downloading a remote file More...
 
EventHandler< ReaderErrorDetectedEventArgsReaderErrorDetected
 Event fired when there was an error reading the data More...
 
EventHandler< StartDateLimitedEventArgsStartDateLimited
 Event fired when the start date has been limited More...
 

Detailed Description

Subscription data reader is a wrapper on the stream reader class to download, unpack and iterate over a data file.

The class accepts any subscription configuration and automatically makes it available to enumerate

Definition at line 37 of file SubscriptionDataReader.cs.

Constructor & Destructor Documentation

◆ SubscriptionDataReader()

QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.SubscriptionDataReader ( SubscriptionDataConfig  config,
BaseDataRequest  dataRequest,
IMapFileProvider  mapFileProvider,
IFactorFileProvider  factorFileProvider,
IDataCacheProvider  dataCacheProvider,
IDataProvider  dataProvider,
IObjectStore  objectStore 
)

Subscription data reader takes a subscription request, loads the type, accepts the data source and enumerate on the results.

Parameters
configSubscription configuration object
dataRequestThe data request
mapFileProviderUsed for resolving the correct map files
factorFileProviderUsed for getting factor files
dataCacheProviderUsed for caching files
dataProviderThe data provider to use

Definition at line 136 of file SubscriptionDataReader.cs.

Member Function Documentation

◆ Initialize()

void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.Initialize ( )

Initializes the SubscriptionDataReader instance

Should be called after all consumers of NewTradableDate event are set, since it will produce events.

Definition at line 165 of file SubscriptionDataReader.cs.

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

◆ MoveNext()

bool QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.MoveNext ( )

Advances the enumerator to the next element of the collection.

Returns
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
Exceptions
T:System.InvalidOperationExceptionThe collection was modified after the enumerator was created.

<filterpriority>2</filterpriority>

Definition at line 263 of file SubscriptionDataReader.cs.

Here is the call graph for this function:

◆ Reset()

void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.Reset ( )

Reset the IEnumeration

Not used

Definition at line 554 of file SubscriptionDataReader.cs.

◆ Dispose()

void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.Dispose ( )

Dispose of the Stream Reader and close out the source stream and file connections.

Definition at line 562 of file SubscriptionDataReader.cs.

◆ OnInvalidConfigurationDetected()

virtual void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.OnInvalidConfigurationDetected ( InvalidConfigurationDetectedEventArgs  e)
protectedvirtual

Event invocator for the InvalidConfigurationDetected event

Parameters
eEvent arguments for the InvalidConfigurationDetected event

Definition at line 572 of file SubscriptionDataReader.cs.

Here is the caller graph for this function:

◆ OnNumericalPrecisionLimited()

virtual void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.OnNumericalPrecisionLimited ( NumericalPrecisionLimitedEventArgs  e)
protectedvirtual

Event invocator for the NumericalPrecisionLimited event

Parameters
eEvent arguments for the NumericalPrecisionLimited event

Definition at line 581 of file SubscriptionDataReader.cs.

Here is the caller graph for this function:

◆ OnStartDateLimited()

virtual void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.OnStartDateLimited ( StartDateLimitedEventArgs  e)
protectedvirtual

Event invocator for the StartDateLimited event

Parameters
eEvent arguments for the StartDateLimited event

Definition at line 590 of file SubscriptionDataReader.cs.

Here is the caller graph for this function:

◆ OnDownloadFailed()

virtual void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.OnDownloadFailed ( DownloadFailedEventArgs  e)
protectedvirtual

Event invocator for the DownloadFailed event

Parameters
eEvent arguments for the DownloadFailed event

Definition at line 599 of file SubscriptionDataReader.cs.

◆ OnReaderErrorDetected()

virtual void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.OnReaderErrorDetected ( ReaderErrorDetectedEventArgs  e)
protectedvirtual

Event invocator for the ReaderErrorDetected event

Parameters
eEvent arguments for the ReaderErrorDetected event

Definition at line 608 of file SubscriptionDataReader.cs.

◆ OnNewTradableDate()

virtual void QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.OnNewTradableDate ( NewTradableDateEventArgs  e)
protectedvirtual

Event invocator for the NewTradableDate event

Parameters
eEvent arguments for the NewTradableDate event

Definition at line 617 of file SubscriptionDataReader.cs.

Property Documentation

◆ Current

BaseData QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.Current
get

Last read BaseData object from this type and source

Definition at line 114 of file SubscriptionDataReader.cs.

Event Documentation

◆ InvalidConfigurationDetected

EventHandler<InvalidConfigurationDetectedEventArgs> QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.InvalidConfigurationDetected

Event fired when an invalid configuration has been detected

Definition at line 83 of file SubscriptionDataReader.cs.

◆ NumericalPrecisionLimited

EventHandler<NumericalPrecisionLimitedEventArgs> QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.NumericalPrecisionLimited

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

Definition at line 88 of file SubscriptionDataReader.cs.

◆ StartDateLimited

EventHandler<StartDateLimitedEventArgs> QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.StartDateLimited

Event fired when the start date has been limited

Definition at line 93 of file SubscriptionDataReader.cs.

◆ DownloadFailed

EventHandler<DownloadFailedEventArgs> QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.DownloadFailed

Event fired when there was an error downloading a remote file

Definition at line 98 of file SubscriptionDataReader.cs.

◆ ReaderErrorDetected

EventHandler<ReaderErrorDetectedEventArgs> QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.ReaderErrorDetected

Event fired when there was an error reading the data

Definition at line 103 of file SubscriptionDataReader.cs.

◆ NewTradableDate

EventHandler<NewTradableDateEventArgs> QuantConnect.Lean.Engine.DataFeeds.SubscriptionDataReader.NewTradableDate

Event fired when there is a new tradable date

Definition at line 108 of file SubscriptionDataReader.cs.


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