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

Provides an implementations of ISubscriptionDataSourceReader that uses the BaseData.Reader(SubscriptionDataConfig,string,DateTime,bool) method to read lines of text from a SubscriptionDataSource More...

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

Public Member Functions

 TextSubscriptionDataSourceReader (IDataCacheProvider dataCacheProvider, SubscriptionDataConfig config, DateTime date, bool isLiveMode, IObjectStore objectStore)
 Initializes a new instance of the TextSubscriptionDataSourceReader class More...
 
override IEnumerable< BaseDataRead (SubscriptionDataSource source)
 Reads the specified source More...
 

Static Public Member Functions

static void SetCacheSize (int megaBytesToUse)
 Set the cache size to use More...
 
static void ClearCache ()
 Will clear the data cache. Used for testing different time zones for the same data set and allow a clean fresh start for each backtest More...
 

Properties

SubscriptionDataConfig Config [get, set]
 The requested subscription configuration More...
 
- Properties inherited from QuantConnect.Lean.Engine.DataFeeds.BaseSubscriptionDataSourceReader
bool IsLiveMode [get]
 True if we're in live mode, false for backtesting More...
 
IDataCacheProvider DataCacheProvider [get]
 The data cache provider to use More...
 
IObjectStore ObjectStore [get]
 The object store to use More...
 

Events

EventHandler< ReaderErrorEventArgsReaderError
 Event fired when an exception is thrown during a call to BaseData.Reader(SubscriptionDataConfig,string,DateTime,bool) More...
 
- Events inherited from QuantConnect.Lean.Engine.DataFeeds.BaseSubscriptionDataSourceReader
EventHandler< InvalidSourceEventArgsInvalidSource
 Event fired when the specified source is considered invalid, this may be from a missing file or failure to download a remote source More...
 
- Events inherited from QuantConnect.Lean.Engine.DataFeeds.ISubscriptionDataSourceReader
EventHandler< InvalidSourceEventArgsInvalidSource
 Event fired when the specified source is considered invalid, this may be from a missing file or failure to download a remote source More...
 

Additional Inherited Members

- Protected Member Functions inherited from QuantConnect.Lean.Engine.DataFeeds.BaseSubscriptionDataSourceReader
 BaseSubscriptionDataSourceReader (IDataCacheProvider dataCacheProvider, bool isLiveMode, IObjectStore objectStore)
 Creates a new instance More...
 
IStreamReader CreateStreamReader (SubscriptionDataSource subscriptionDataSource)
 Creates a new IStreamReader for the specified subscriptionDataSource More...
 
void OnInvalidSource (SubscriptionDataSource source, Exception exception)
 Event invocator for the InvalidSource event More...
 

Detailed Description

Provides an implementations of ISubscriptionDataSourceReader that uses the BaseData.Reader(SubscriptionDataConfig,string,DateTime,bool) method to read lines of text from a SubscriptionDataSource

Definition at line 32 of file TextSubscriptionDataSourceReader.cs.

Constructor & Destructor Documentation

◆ TextSubscriptionDataSourceReader()

QuantConnect.Lean.Engine.DataFeeds.TextSubscriptionDataSourceReader.TextSubscriptionDataSourceReader ( IDataCacheProvider  dataCacheProvider,
SubscriptionDataConfig  config,
DateTime  date,
bool  isLiveMode,
IObjectStore  objectStore 
)

Initializes a new instance of the TextSubscriptionDataSourceReader class

Parameters
dataCacheProviderThis provider caches files if needed
configThe subscription's configuration
dateThe date this factory was produced to read data for
isLiveModeTrue if we're in live mode, false for backtesting
objectStoreThe object storage for data persistence.

Definition at line 62 of file TextSubscriptionDataSourceReader.cs.

Member Function Documentation

◆ Read()

override IEnumerable<BaseData> QuantConnect.Lean.Engine.DataFeeds.TextSubscriptionDataSourceReader.Read ( SubscriptionDataSource  source)
virtual

Reads the specified source

Parameters
sourceThe source to be read
Returns
An IEnumerable<BaseData> that contains the data in the source

Implements QuantConnect.Lean.Engine.DataFeeds.BaseSubscriptionDataSourceReader.

Definition at line 82 of file TextSubscriptionDataSourceReader.cs.

Here is the call graph for this function:

◆ SetCacheSize()

static void QuantConnect.Lean.Engine.DataFeeds.TextSubscriptionDataSourceReader.SetCacheSize ( int  megaBytesToUse)
static

Set the cache size to use

How to size this cache: Take worst case scenario, BTCUSD hour, 60k QuoteBar entries, which are roughly 200 bytes in size -> 11 MB * CacheSize

Definition at line 214 of file TextSubscriptionDataSourceReader.cs.

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

◆ ClearCache()

static void QuantConnect.Lean.Engine.DataFeeds.TextSubscriptionDataSourceReader.ClearCache ( )
static

Will clear the data cache. Used for testing different time zones for the same data set and allow a clean fresh start for each backtest

Definition at line 228 of file TextSubscriptionDataSourceReader.cs.

Property Documentation

◆ Config

SubscriptionDataConfig QuantConnect.Lean.Engine.DataFeeds.TextSubscriptionDataSourceReader.Config
getsetprotected

The requested subscription configuration

Definition at line 46 of file TextSubscriptionDataSourceReader.cs.

Event Documentation

◆ ReaderError

EventHandler<ReaderErrorEventArgs> QuantConnect.Lean.Engine.DataFeeds.TextSubscriptionDataSourceReader.ReaderError

Event fired when an exception is thrown during a call to BaseData.Reader(SubscriptionDataConfig,string,DateTime,bool)

Definition at line 52 of file TextSubscriptionDataSourceReader.cs.


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