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

DataManager will manage the subscriptions for both the DataFeeds and the SubscriptionManager More...

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

Public Member Functions

 DataManager (IDataFeed dataFeed, UniverseSelection universeSelection, IAlgorithm algorithm, ITimeKeeper timeKeeper, MarketHoursDatabase marketHoursDatabase, bool liveMode, IRegisteredSecurityDataTypesProvider registeredTypesProvider, IDataPermissionManager dataPermissionManager)
 Creates a new instance of the DataManager More...
 
void RemoveAllSubscriptions ()
 Will remove all current Subscription More...
 
bool AddSubscription (SubscriptionRequest request)
 Adds a new Subscription to provide data for the specified security. More...
 
bool RemoveSubscription (SubscriptionDataConfig configuration, Universe universe=null)
 Removes the Subscription, if it exists More...
 
SubscriptionDataConfig SubscriptionManagerGetOrAdd (SubscriptionDataConfig newConfig)
 Gets existing or adds new SubscriptionDataConfig More...
 
int SubscriptionManagerCount ()
 Returns the amount of data config subscriptions processed for the SubscriptionManager More...
 
SubscriptionDataConfig Add (Type dataType, Symbol symbol, Resolution? resolution=null, bool fillForward=true, bool extendedMarketHours=false, bool isFilteredSubscription=true, bool isInternalFeed=false, bool isCustomData=false, DataNormalizationMode dataNormalizationMode=DataNormalizationMode.Adjusted, DataMappingMode dataMappingMode=DataMappingMode.OpenInterest, uint contractDepthOffset=0)
 Creates and adds a list of SubscriptionDataConfig for a given symbol and configuration. Can optionally pass in desired subscription data type to use. If the config already existed will return existing instance instead More...
 
List< SubscriptionDataConfigAdd (Symbol symbol, Resolution? resolution=null, bool fillForward=true, bool extendedMarketHours=false, bool isFilteredSubscription=true, bool isInternalFeed=false, bool isCustomData=false, List< Tuple< Type, TickType >> subscriptionDataTypes=null, DataNormalizationMode dataNormalizationMode=DataNormalizationMode.Adjusted, DataMappingMode dataMappingMode=DataMappingMode.OpenInterest, uint contractDepthOffset=0)
 Creates and adds a list of SubscriptionDataConfig for a given symbol and configuration. Can optionally pass in desired subscription data types to use. If the config already existed will return existing instance instead More...
 
List< Tuple< Type, TickType > > LookupSubscriptionConfigDataTypes (SecurityType symbolSecurityType, Resolution resolution, bool isCanonical)
 Get the data feed types for a given SecurityType Resolution More...
 
List< SubscriptionDataConfigGetSubscriptionDataConfigs (Symbol symbol=null, bool includeInternalConfigs=false)
 Gets a list of all registered SubscriptionDataConfig for a given Symbol More...
 

Properties

SubscriptionCollection DataFeedSubscriptions [get]
 Gets the data feed subscription collection More...
 
IEnumerable< SubscriptionDataConfigSubscriptionManagerSubscriptions [get]
 Gets all the current data config subscriptions that are being processed for the SubscriptionManager More...
 
Dictionary< SecurityType, List< TickType > > AvailableDataTypes [get]
 The different TickType each SecurityType supports More...
 
UniverseSelection UniverseSelection [get]
 Get the universe selection instance More...
 
- Properties inherited from QuantConnect.Interfaces.IAlgorithmSubscriptionManager
IEnumerable< SubscriptionDataConfigSubscriptionManagerSubscriptions [get]
 Gets all the current data config subscriptions that are being processed for the SubscriptionManager More...
 
- Properties inherited from QuantConnect.Interfaces.ISubscriptionDataConfigService
Dictionary< SecurityType, List< TickType > > AvailableDataTypes [get]
 Gets the available data types More...
 
- Properties inherited from QuantConnect.Lean.Engine.DataFeeds.IDataFeedSubscriptionManager
SubscriptionCollection DataFeedSubscriptions [get]
 Gets the data feed subscription collection More...
 
UniverseSelection UniverseSelection [get]
 Get the universe selection instance More...
 
- Properties inherited from QuantConnect.Lean.Engine.DataFeeds.IDataManager
UniverseSelection UniverseSelection [get]
 Get the universe selection instance More...
 

Events

EventHandler< SubscriptionSubscriptionAdded
 Event fired when a new subscription is added More...
 
EventHandler< SubscriptionSubscriptionRemoved
 Event fired when an existing subscription is removed More...
 
- Events inherited from QuantConnect.Lean.Engine.DataFeeds.IDataFeedSubscriptionManager
EventHandler< SubscriptionSubscriptionAdded
 Event fired when a new subscription is added More...
 
EventHandler< SubscriptionSubscriptionRemoved
 Event fired when an existing subscription is removed More...
 

Detailed Description

DataManager will manage the subscriptions for both the DataFeeds and the SubscriptionManager

Definition at line 35 of file DataManager.cs.

Constructor & Destructor Documentation

◆ DataManager()

QuantConnect.Lean.Engine.DataFeeds.DataManager.DataManager ( IDataFeed  dataFeed,
UniverseSelection  universeSelection,
IAlgorithm  algorithm,
ITimeKeeper  timeKeeper,
MarketHoursDatabase  marketHoursDatabase,
bool  liveMode,
IRegisteredSecurityDataTypesProvider  registeredTypesProvider,
IDataPermissionManager  dataPermissionManager 
)

Creates a new instance of the DataManager

Definition at line 63 of file DataManager.cs.

Here is the call graph for this function:

Member Function Documentation

◆ RemoveAllSubscriptions()

void QuantConnect.Lean.Engine.DataFeeds.DataManager.RemoveAllSubscriptions ( )

Will remove all current Subscription

Definition at line 252 of file DataManager.cs.

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

◆ AddSubscription()

bool QuantConnect.Lean.Engine.DataFeeds.DataManager.AddSubscription ( SubscriptionRequest  request)

Adds a new Subscription to provide data for the specified security.

Parameters
requestDefines the SubscriptionRequest to be added
Returns
True if the subscription was created and added successfully, false otherwise

Implements QuantConnect.Lean.Engine.DataFeeds.IDataFeedSubscriptionManager.

Definition at line 274 of file DataManager.cs.

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

◆ RemoveSubscription()

bool QuantConnect.Lean.Engine.DataFeeds.DataManager.RemoveSubscription ( SubscriptionDataConfig  configuration,
Universe  universe = null 
)

Removes the Subscription, if it exists

Parameters
configurationThe SubscriptionDataConfig of the subscription to remove
universeUniverse requesting to remove Subscription. Default value, null, will remove all universes
Returns
True if the subscription was successfully removed, false otherwise

Implements QuantConnect.Lean.Engine.DataFeeds.IDataFeedSubscriptionManager.

Definition at line 337 of file DataManager.cs.

Here is the caller graph for this function:

◆ SubscriptionManagerGetOrAdd()

SubscriptionDataConfig QuantConnect.Lean.Engine.DataFeeds.DataManager.SubscriptionManagerGetOrAdd ( SubscriptionDataConfig  newConfig)

Gets existing or adds new SubscriptionDataConfig

Returns
Returns the SubscriptionDataConfig instance used

Definition at line 455 of file DataManager.cs.

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

◆ SubscriptionManagerCount()

int QuantConnect.Lean.Engine.DataFeeds.DataManager.SubscriptionManagerCount ( )

Returns the amount of data config subscriptions processed for the SubscriptionManager

Implements QuantConnect.Interfaces.IAlgorithmSubscriptionManager.

Definition at line 509 of file DataManager.cs.

◆ Add() [1/2]

SubscriptionDataConfig QuantConnect.Lean.Engine.DataFeeds.DataManager.Add ( Type  dataType,
Symbol  symbol,
Resolution resolution = null,
bool  fillForward = true,
bool  extendedMarketHours = false,
bool  isFilteredSubscription = true,
bool  isInternalFeed = false,
bool  isCustomData = false,
DataNormalizationMode  dataNormalizationMode = DataNormalizationMode.Adjusted,
DataMappingMode  dataMappingMode = DataMappingMode.OpenInterest,
uint  contractDepthOffset = 0 
)

Creates and adds a list of SubscriptionDataConfig for a given symbol and configuration. Can optionally pass in desired subscription data type to use. If the config already existed will return existing instance instead

Implements QuantConnect.Interfaces.ISubscriptionDataConfigService.

Definition at line 529 of file DataManager.cs.

Here is the call graph for this function:

◆ Add() [2/2]

List<SubscriptionDataConfig> QuantConnect.Lean.Engine.DataFeeds.DataManager.Add ( Symbol  symbol,
Resolution resolution = null,
bool  fillForward = true,
bool  extendedMarketHours = false,
bool  isFilteredSubscription = true,
bool  isInternalFeed = false,
bool  isCustomData = false,
List< Tuple< Type, TickType >>  subscriptionDataTypes = null,
DataNormalizationMode  dataNormalizationMode = DataNormalizationMode.Adjusted,
DataMappingMode  dataMappingMode = DataMappingMode.OpenInterest,
uint  contractDepthOffset = 0 
)

Creates and adds a list of SubscriptionDataConfig for a given symbol and configuration. Can optionally pass in desired subscription data types to use. If the config already existed will return existing instance instead

Implements QuantConnect.Interfaces.ISubscriptionDataConfigService.

Definition at line 554 of file DataManager.cs.

Here is the call graph for this function:

◆ LookupSubscriptionConfigDataTypes()

List<Tuple<Type, TickType> > QuantConnect.Lean.Engine.DataFeeds.DataManager.LookupSubscriptionConfigDataTypes ( SecurityType  symbolSecurityType,
Resolution  resolution,
bool  isCanonical 
)

Get the data feed types for a given SecurityType Resolution

Parameters
symbolSecurityTypeThe SecurityType used to determine the types
resolutionThe resolution of the data requested
isCanonicalIndicates whether the security is Canonical (future and options)
Returns
Types that should be added to the SubscriptionDataConfig

TODO: data type additions are very related to ticktype and should be more generic/independent of each other

Implements QuantConnect.Interfaces.ISubscriptionDataConfigService.

Definition at line 682 of file DataManager.cs.

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

◆ GetSubscriptionDataConfigs()

List<SubscriptionDataConfig> QuantConnect.Lean.Engine.DataFeeds.DataManager.GetSubscriptionDataConfigs ( Symbol  symbol = null,
bool  includeInternalConfigs = false 
)

Gets a list of all registered SubscriptionDataConfig for a given Symbol

Will not return internal subscriptions by default

Implements QuantConnect.Interfaces.ISubscriptionDataConfigProvider.

Definition at line 716 of file DataManager.cs.

Property Documentation

◆ DataFeedSubscriptions

SubscriptionCollection QuantConnect.Lean.Engine.DataFeeds.DataManager.DataFeedSubscriptions
get

Gets the data feed subscription collection

Definition at line 247 of file DataManager.cs.

◆ SubscriptionManagerSubscriptions

IEnumerable<SubscriptionDataConfig> QuantConnect.Lean.Engine.DataFeeds.DataManager.SubscriptionManagerSubscriptions
get

Gets all the current data config subscriptions that are being processed for the SubscriptionManager

Definition at line 437 of file DataManager.cs.

◆ AvailableDataTypes

Dictionary<SecurityType, List<TickType> > QuantConnect.Lean.Engine.DataFeeds.DataManager.AvailableDataTypes
get

The different TickType each SecurityType supports

Definition at line 522 of file DataManager.cs.

◆ UniverseSelection

UniverseSelection QuantConnect.Lean.Engine.DataFeeds.DataManager.UniverseSelection
get

Get the universe selection instance

Definition at line 734 of file DataManager.cs.

Event Documentation

◆ SubscriptionAdded

EventHandler<Subscription> QuantConnect.Lean.Engine.DataFeeds.DataManager.SubscriptionAdded

Event fired when a new subscription is added

Definition at line 53 of file DataManager.cs.

◆ SubscriptionRemoved

EventHandler<Subscription> QuantConnect.Lean.Engine.DataFeeds.DataManager.SubscriptionRemoved

Event fired when an existing subscription is removed

Definition at line 58 of file DataManager.cs.


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