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

An instance of the IDataProvider that will download and update data files as needed via QC's Api. More...

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

Public Member Functions

 ApiDataProvider ()
 Initialize a new instance of the ApiDataProvider More...
 
override Stream Fetch (string key)
 Retrieves data to be used in an algorithm. If file does not exist, an attempt is made to download them from the api 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...
 

Protected Member Functions

override bool NeedToDownload (string filePath)
 Main filter to determine if this file needs to be downloaded More...
 
virtual bool DownloadData (string filePath)
 Attempt to download data using the Api for and return a FileStream of that data. 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...
 
virtual Stream GetStream (string key)
 Get's the stream for a given file path 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

An instance of the IDataProvider that will download and update data files as needed via QC's Api.

Definition at line 33 of file ApiDataProvider.cs.

Constructor & Destructor Documentation

◆ ApiDataProvider()

QuantConnect.Lean.Engine.DataFeeds.ApiDataProvider.ApiDataProvider ( )

Initialize a new instance of the ApiDataProvider

Definition at line 48 of file ApiDataProvider.cs.

Here is the call graph for this function:

Member Function Documentation

◆ Fetch()

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

Retrieves data to be used in an algorithm. If file does not exist, an attempt is made to download them from the api

Parameters
keyFile path representing where the data requested
Returns
A Stream of the data requested

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

Definition at line 125 of file ApiDataProvider.cs.

Here is the call graph for this function:

◆ NeedToDownload()

override bool QuantConnect.Lean.Engine.DataFeeds.ApiDataProvider.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 157 of file ApiDataProvider.cs.

Here is the call graph for this function:

◆ DownloadData()

virtual bool QuantConnect.Lean.Engine.DataFeeds.ApiDataProvider.DownloadData ( string  filePath)
protectedvirtual

Attempt to download data using the Api for and return a FileStream of that data.

Parameters
filePathThe path to store the file
Returns
A FileStream of the data

Definition at line 227 of file ApiDataProvider.cs.

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

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