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

Data provider which downloads data using an IDataDownloader or IBrokerage implementation More...

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

Public Member Functions

 DownloaderDataProvider ()
 Creates a new instance More...
 
 DownloaderDataProvider (IDataDownloader dataDownloader)
 Creates a new instance using a target data downloader used for testing More...
 
override Stream Fetch (string key)
 Determines if it should downloads new data and retrieves data from disc More...
 
IEnumerable< IGrouping< Symbol, BaseData > > GetDownloadedData (IEnumerable< DataDownloaderGetParameters > downloaderDataParameters, Symbol symbol, DateTimeZone exchangeTimeZone, DateTimeZone dataTimeZone, Type dataType)
 Retrieves downloaded data grouped by symbol based on IDownloadProvider. More...
 
- Public Member Functions inherited from QuantConnect.Lean.Engine.DataFeeds.DefaultDataProvider
void Dispose ()
 The stream created by this type is passed up the stack to the IStreamReader The stream is closed when the StreamReader that wraps this stream is disposed More...
 

Static Public Member Functions

static IEnumerable< IGrouping< Symbol, BaseData > > FilterAndGroupDownloadDataBySymbol (IEnumerable< BaseData > downloadData, Symbol symbol, Type dataType, DateTimeZone exchangeTimeZone, DateTimeZone dataTimeZone, DateTime downloaderStartTimeUtc, DateTime downloaderEndTimeUtc)
 Filters and groups the provided download data by symbol, based on specified criteria. More...
 

Protected Member Functions

override Stream GetStream (string key)
 Get's the stream for a given file path More...
 
override bool NeedToDownload (string filePath)
 Main filter to determine if this file needs to be downloaded More...
 
- Protected Member Functions inherited from QuantConnect.Lean.Engine.DataFeeds.BaseDownloaderDataProvider
Stream DownloadOnce (string key, Action< string > download)
 Helper method which guarantees each requested key is downloaded only once concurrently if required based on NeedToDownload More...
 
- Protected Member Functions inherited from QuantConnect.Lean.Engine.DataFeeds.DefaultDataProvider
virtual void OnNewDataRequest (DataProviderNewDataRequestEventArgs e)
 Event invocator for the NewDataRequest event More...
 

Additional Inherited Members

- Events inherited from QuantConnect.Lean.Engine.DataFeeds.DefaultDataProvider
EventHandler< DataProviderNewDataRequestEventArgsNewDataRequest
 Event raised each time data fetch is finished (successfully or not) More...
 
- Events inherited from QuantConnect.Interfaces.IDataProvider
EventHandler< DataProviderNewDataRequestEventArgsNewDataRequest
 Event raised each time data fetch is finished (successfully or not) More...
 

Detailed Description

Data provider which downloads data using an IDataDownloader or IBrokerage implementation

Definition at line 35 of file DownloaderDataProvider.cs.

Constructor & Destructor Documentation

◆ DownloaderDataProvider() [1/2]

QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider.DownloaderDataProvider ( )

Creates a new instance

Definition at line 52 of file DownloaderDataProvider.cs.

Here is the call graph for this function:

◆ DownloaderDataProvider() [2/2]

QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider.DownloaderDataProvider ( IDataDownloader  dataDownloader)

Creates a new instance using a target data downloader used for testing

Definition at line 68 of file DownloaderDataProvider.cs.

Member Function Documentation

◆ Fetch()

override Stream QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider.Fetch ( string  key)
virtual

Determines if it should downloads new data and retrieves data from disc

Parameters
keyA string representing where the data is stored
Returns
A Stream of the data requested

Reimplemented from QuantConnect.Lean.Engine.DataFeeds.DefaultDataProvider.

Definition at line 78 of file DownloaderDataProvider.cs.

Here is the call graph for this function:

◆ GetDownloadedData()

IEnumerable<IGrouping<Symbol, BaseData> > QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider.GetDownloadedData ( IEnumerable< DataDownloaderGetParameters downloaderDataParameters,
Symbol  symbol,
DateTimeZone  exchangeTimeZone,
DateTimeZone  dataTimeZone,
Type  dataType 
)

Retrieves downloaded data grouped by symbol based on IDownloadProvider.

Parameters
downloaderDataParametersParameters specifying the data to be retrieved.
symbolRepresents a unique security identifier, generate by ticker name.
exchangeTimeZoneThe time zone of the exchange where the symbol is traded.
dataTimeZoneThe time zone in which the data is represented.
dataTypeThe type of data to be retrieved. (e.g. Data.Market.TradeBar)
Returns
An IEnumerable containing groups of data grouped by symbol. Each group contains data related to a specific symbol.
Exceptions
ArgumentExceptionThrown when the downloaderDataParameters collection is null or empty.

Definition at line 206 of file DownloaderDataProvider.cs.

◆ GetStream()

override Stream QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider.GetStream ( string  key)
protectedvirtual

Get's the stream for a given file path

Reimplemented from QuantConnect.Lean.Engine.DataFeeds.BaseDownloaderDataProvider.

Definition at line 247 of file DownloaderDataProvider.cs.

Here is the call graph for this function:

◆ NeedToDownload()

override bool QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider.NeedToDownload ( string  filePath)
protectedvirtual

Main filter to determine if this file needs to be downloaded

Parameters
filePathFile we are looking at
Returns
True if should download

Implements QuantConnect.Lean.Engine.DataFeeds.BaseDownloaderDataProvider.

Definition at line 277 of file DownloaderDataProvider.cs.

◆ FilterAndGroupDownloadDataBySymbol()

static IEnumerable<IGrouping<Symbol, BaseData> > QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider.FilterAndGroupDownloadDataBySymbol ( IEnumerable< BaseData downloadData,
Symbol  symbol,
Type  dataType,
DateTimeZone  exchangeTimeZone,
DateTimeZone  dataTimeZone,
DateTime  downloaderStartTimeUtc,
DateTime  downloaderEndTimeUtc 
)
static

Filters and groups the provided download data by symbol, based on specified criteria.

Parameters
downloadDataThe collection of download data to process.
symbolThe symbol to filter the data for.
dataTypeThe type of data to filter for.
exchangeTimeZoneThe time zone of the exchange.
dataTimeZoneThe desired time zone for the data.
downloaderStartTimeUtcThe start time of data downloading in UTC.
downloaderEndTimeUtcThe end time of data downloading in UTC.
Returns
An enumerable collection of groupings of download data, grouped by symbol.

Definition at line 307 of file DownloaderDataProvider.cs.


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