Lean  $LEAN_TAG$
QuantConnect.Data.SubscriptionManager Class Reference

Enumerable Subscription Management Class More...

Public Member Functions

 SubscriptionManager (ITimeKeeper timeKeeper)
 Creates a new instance More...
 
SubscriptionDataConfig Add (Symbol symbol, Resolution resolution, DateTimeZone timeZone, DateTimeZone exchangeTimeZone, bool isCustomData=false, bool fillForward=true, bool extendedMarketHours=false)
 Add Market Data Required (Overloaded method for backwards compatibility). More...
 
SubscriptionDataConfig Add (Type dataType, TickType tickType, Symbol symbol, Resolution resolution, DateTimeZone dataTimeZone, DateTimeZone exchangeTimeZone, bool isCustomData, bool fillForward=true, bool extendedMarketHours=false, bool isInternalFeed=false, bool isFilteredSubscription=true, DataNormalizationMode dataNormalizationMode=DataNormalizationMode.Adjusted)
 Add Market Data Required - generic data typing support as long as Type implements BaseData. More...
 
void AddConsolidator (Symbol symbol, IDataConsolidator consolidator, TickType? tickType=null)
 Add a consolidator for the symbol More...
 
void AddConsolidator (Symbol symbol, PyObject pyConsolidator)
 Add a custom python consolidator for the symbol More...
 
void RemoveConsolidator (Symbol symbol, IDataConsolidator consolidator)
 Removes the specified consolidator for the symbol More...
 
void RemoveConsolidator (Symbol symbol, PyObject pyConsolidator)
 Removes the specified python consolidator for the symbol More...
 
void ScanPastConsolidators (DateTime newUtcTime, IAlgorithm algorithm)
 Will trigger past consolidator scans More...
 
IReadOnlyList< TickTypeGetDataTypesForSecurity (SecurityType securityType)
 Get the available data types for a security More...
 
List< Tuple< Type, TickType > > LookupSubscriptionConfigDataTypes (SecurityType symbolSecurityType, Resolution resolution, bool isCanonical)
 Get the data feed types for a given SecurityType Resolution More...
 
void SetDataManager (IAlgorithmSubscriptionManager subscriptionManager)
 Sets the Subscription Manager More...
 

Static Public Member Functions

static Dictionary< SecurityType, List< TickType > > DefaultDataTypes ()
 Hard code the set of default available data feeds More...
 
static bool IsSubscriptionValidForConsolidator (SubscriptionDataConfig subscription, IDataConsolidator consolidator, TickType? desiredTickType=null)
 Checks if the subscription is valid for the consolidator More...
 

Public Attributes

ISubscriptionDataConfigService SubscriptionDataConfigService => _subscriptionManager
 Instance that implements ISubscriptionDataConfigService More...
 
IEnumerable< SubscriptionDataConfigSubscriptions => _subscriptionManager.SubscriptionManagerSubscriptions.Where(config => !config.IsInternalFeed)
 Returns an IEnumerable of Subscriptions More...
 
Dictionary< SecurityType, List< TickType > > AvailableDataTypes => _subscriptionManager.AvailableDataTypes
 The different TickType each SecurityType supports More...
 
int Count => _subscriptionManager.SubscriptionManagerCount()
 Get the count of assets: More...
 

Detailed Description

Enumerable Subscription Management Class

Definition at line 32 of file SubscriptionManager.cs.

Constructor & Destructor Documentation

◆ SubscriptionManager()

QuantConnect.Data.SubscriptionManager.SubscriptionManager ( ITimeKeeper  timeKeeper)

Creates a new instance

Definition at line 65 of file SubscriptionManager.cs.

Member Function Documentation

◆ Add() [1/2]

SubscriptionDataConfig QuantConnect.Data.SubscriptionManager.Add ( Symbol  symbol,
Resolution  resolution,
DateTimeZone  timeZone,
DateTimeZone  exchangeTimeZone,
bool  isCustomData = false,
bool  fillForward = true,
bool  extendedMarketHours = false 
)

Add Market Data Required (Overloaded method for backwards compatibility).

Parameters
symbolSymbol of the asset we're like
resolutionResolution of Asset Required
timeZoneThe time zone the subscription's data is time stamped in
exchangeTimeZoneSpecifies the time zone of the exchange for the security this subscription is for. This is this output time zone, that is, the time zone that will be used on BaseData instances
isCustomDataTrue if this is custom user supplied data, false for normal QC data
fillForwardwhen there is no data pass the last tradebar forward
extendedMarketHoursRequest premarket data as well when true
Returns
The newly created SubscriptionDataConfig or existing instance if it already existed

Definition at line 89 of file SubscriptionManager.cs.

Here is the call graph for this function:

◆ Add() [2/2]

SubscriptionDataConfig QuantConnect.Data.SubscriptionManager.Add ( Type  dataType,
TickType  tickType,
Symbol  symbol,
Resolution  resolution,
DateTimeZone  dataTimeZone,
DateTimeZone  exchangeTimeZone,
bool  isCustomData,
bool  fillForward = true,
bool  extendedMarketHours = false,
bool  isInternalFeed = false,
bool  isFilteredSubscription = true,
DataNormalizationMode  dataNormalizationMode = DataNormalizationMode.Adjusted 
)

Add Market Data Required - generic data typing support as long as Type implements BaseData.

Parameters
dataTypeSet the type of the data we're subscribing to.
tickTypeTick type for the subscription.
symbolSymbol of the asset we're like
resolutionResolution of Asset Required
dataTimeZoneThe time zone the subscription's data is time stamped in
exchangeTimeZoneSpecifies the time zone of the exchange for the security this subscription is for. This is this output time zone, that is, the time zone that will be used on BaseData instances
isCustomDataTrue if this is custom user supplied data, false for normal QC data
fillForwardwhen there is no data pass the last tradebar forward
extendedMarketHoursRequest premarket data as well when true
isInternalFeedSet to true to prevent data from this subscription from being sent into the algorithm's OnData events
isFilteredSubscriptionTrue if this subscription should have filters applied to it (market hours/user filters from security), false otherwise
dataNormalizationModeDefine how data is normalized
Returns
The newly created SubscriptionDataConfig or existing instance if it already existed

Definition at line 138 of file SubscriptionManager.cs.

Here is the call graph for this function:

◆ AddConsolidator() [1/2]

void QuantConnect.Data.SubscriptionManager.AddConsolidator ( Symbol  symbol,
IDataConsolidator  consolidator,
TickType tickType = null 
)

Add a consolidator for the symbol

Parameters
symbolSymbol of the asset to consolidate
consolidatorThe consolidator
tickTypeDesired tick type for the subscription

Definition at line 165 of file SubscriptionManager.cs.

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

◆ AddConsolidator() [2/2]

void QuantConnect.Data.SubscriptionManager.AddConsolidator ( Symbol  symbol,
PyObject  pyConsolidator 
)

Add a custom python consolidator for the symbol

Parameters
symbolSymbol of the asset to consolidate
pyConsolidatorThe custom python consolidator

Definition at line 212 of file SubscriptionManager.cs.

Here is the call graph for this function:

◆ RemoveConsolidator() [1/2]

void QuantConnect.Data.SubscriptionManager.RemoveConsolidator ( Symbol  symbol,
IDataConsolidator  consolidator 
)

Removes the specified consolidator for the symbol

Parameters
symbolThe symbol the consolidator is receiving data from
consolidatorThe consolidator instance to be removed

Definition at line 227 of file SubscriptionManager.cs.

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

◆ RemoveConsolidator() [2/2]

void QuantConnect.Data.SubscriptionManager.RemoveConsolidator ( Symbol  symbol,
PyObject  pyConsolidator 
)

Removes the specified python consolidator for the symbol

Parameters
symbolThe symbol the consolidator is receiving data from
pyConsolidatorThe python consolidator instance to be removed

Definition at line 253 of file SubscriptionManager.cs.

Here is the call graph for this function:

◆ ScanPastConsolidators()

void QuantConnect.Data.SubscriptionManager.ScanPastConsolidators ( DateTime  newUtcTime,
IAlgorithm  algorithm 
)

Will trigger past consolidator scans

Parameters
newUtcTimeThe new utc time
algorithmThe algorithm instance

Definition at line 268 of file SubscriptionManager.cs.

Here is the call graph for this function:

◆ DefaultDataTypes()

static Dictionary<SecurityType, List<TickType> > QuantConnect.Data.SubscriptionManager.DefaultDataTypes ( )
static

Hard code the set of default available data feeds

Definition at line 307 of file SubscriptionManager.cs.

Here is the caller graph for this function:

◆ GetDataTypesForSecurity()

IReadOnlyList<TickType> QuantConnect.Data.SubscriptionManager.GetDataTypesForSecurity ( SecurityType  securityType)

Get the available data types for a security

Definition at line 329 of file SubscriptionManager.cs.

◆ LookupSubscriptionConfigDataTypes()

List<Tuple<Type, TickType> > QuantConnect.Data.SubscriptionManager.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

Definition at line 341 of file SubscriptionManager.cs.

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

◆ SetDataManager()

void QuantConnect.Data.SubscriptionManager.SetDataManager ( IAlgorithmSubscriptionManager  subscriptionManager)

Sets the Subscription Manager

Definition at line 353 of file SubscriptionManager.cs.

Here is the caller graph for this function:

◆ IsSubscriptionValidForConsolidator()

static bool QuantConnect.Data.SubscriptionManager.IsSubscriptionValidForConsolidator ( SubscriptionDataConfig  subscription,
IDataConsolidator  consolidator,
TickType desiredTickType = null 
)
static

Checks if the subscription is valid for the consolidator

Parameters
subscriptionThe subscription configuration
consolidatorThe consolidator
desiredTickTypeThe desired tick type for the subscription. If not given is null.
Returns
true if the subscription is valid for the consolidator

Definition at line 365 of file SubscriptionManager.cs.

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

Member Data Documentation

◆ SubscriptionDataConfigService

ISubscriptionDataConfigService QuantConnect.Data.SubscriptionManager.SubscriptionDataConfigService => _subscriptionManager

Instance that implements ISubscriptionDataConfigService

Definition at line 44 of file SubscriptionManager.cs.

◆ Subscriptions

IEnumerable<SubscriptionDataConfig> QuantConnect.Data.SubscriptionManager.Subscriptions => _subscriptionManager.SubscriptionManagerSubscriptions.Where(config => !config.IsInternalFeed)

Returns an IEnumerable of Subscriptions

Will not return internal subscriptions

Definition at line 50 of file SubscriptionManager.cs.

◆ AvailableDataTypes

Dictionary<SecurityType, List<TickType> > QuantConnect.Data.SubscriptionManager.AvailableDataTypes => _subscriptionManager.AvailableDataTypes

The different TickType each SecurityType supports

Definition at line 55 of file SubscriptionManager.cs.

◆ Count

int QuantConnect.Data.SubscriptionManager.Count => _subscriptionManager.SubscriptionManagerCount()

Get the count of assets:

Definition at line 60 of file SubscriptionManager.cs.


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