Lean  $LEAN_TAG$
QuantConnect.Data.SubscriptionDataConfigExtensions Class Reference

Helper methods used to determine different configurations properties for a given set of SubscriptionDataConfig More...

Static Public Member Functions

static Resolution GetHighestResolution (this IEnumerable< SubscriptionDataConfig > subscriptionDataConfigs)
 Extension method used to obtain the highest Resolution for a given set of SubscriptionDataConfig More...
 
static bool IsFillForward (this IEnumerable< SubscriptionDataConfig > subscriptionDataConfigs)
 Extension method used to determine if FillForward is enabled for a given set of SubscriptionDataConfig More...
 
static bool IsExtendedMarketHours (this IEnumerable< SubscriptionDataConfig > subscriptionDataConfigs)
 Extension method used to determine if ExtendedMarketHours is enabled for a given set of SubscriptionDataConfig More...
 
static bool IsCustomData (this IEnumerable< SubscriptionDataConfig > subscriptionDataConfigs)
 Extension method used to determine if it is custom data for a given set of SubscriptionDataConfig More...
 
static DataNormalizationMode DataNormalizationMode (this IEnumerable< SubscriptionDataConfig > subscriptionDataConfigs)
 Extension method used to determine what QuantConnect.DataNormalizationMode to use for a given set of SubscriptionDataConfig More...
 
static void SetDataNormalizationMode (this IEnumerable< SubscriptionDataConfig > subscriptionDataConfigs, DataNormalizationMode mode)
 Sets the data normalization mode to be used by this set of SubscriptionDataConfig More...
 
static bool TickerShouldBeMapped (this SubscriptionDataConfig config)
 Will determine if mapping should be used for this subscription configuration More...
 
static bool PricesShouldBeScaled (this SubscriptionDataConfig config, bool liveMode=false)
 Will determine if price scaling should be used for this subscription configuration More...
 
static bool EmitSplitsAndDividends (this SubscriptionDataConfig config)
 Will determine if splits and dividends should be used for this subscription configuration More...
 
static BaseData GetBaseDataInstance (this SubscriptionDataConfig config)
 Initializes a new instance of the BaseData type defined in config with the symbol properly set More...
 

Detailed Description

Helper methods used to determine different configurations properties for a given set of SubscriptionDataConfig

Definition at line 26 of file SubscriptionDataConfigExtensions.cs.

Member Function Documentation

◆ GetHighestResolution()

static Resolution QuantConnect.Data.SubscriptionDataConfigExtensions.GetHighestResolution ( this IEnumerable< SubscriptionDataConfig subscriptionDataConfigs)
static

Extension method used to obtain the highest Resolution for a given set of SubscriptionDataConfig

Parameters
subscriptionDataConfigs
Returns
The highest resolution, Resolution.Daily if there are no subscriptions

Definition at line 35 of file SubscriptionDataConfigExtensions.cs.

◆ IsFillForward()

static bool QuantConnect.Data.SubscriptionDataConfigExtensions.IsFillForward ( this IEnumerable< SubscriptionDataConfig subscriptionDataConfigs)
static

Extension method used to determine if FillForward is enabled for a given set of SubscriptionDataConfig

Parameters
subscriptionDataConfigs
Returns
True, at least one subscription has it enabled

Definition at line 50 of file SubscriptionDataConfigExtensions.cs.

◆ IsExtendedMarketHours()

static bool QuantConnect.Data.SubscriptionDataConfigExtensions.IsExtendedMarketHours ( this IEnumerable< SubscriptionDataConfig subscriptionDataConfigs)
static

Extension method used to determine if ExtendedMarketHours is enabled for a given set of SubscriptionDataConfig

Parameters
subscriptionDataConfigs
Returns
True, at least one subscription has it enabled

Definition at line 62 of file SubscriptionDataConfigExtensions.cs.

◆ IsCustomData()

static bool QuantConnect.Data.SubscriptionDataConfigExtensions.IsCustomData ( this IEnumerable< SubscriptionDataConfig subscriptionDataConfigs)
static

Extension method used to determine if it is custom data for a given set of SubscriptionDataConfig

Parameters
subscriptionDataConfigs
Returns
True, at least one subscription is custom data

Definition at line 74 of file SubscriptionDataConfigExtensions.cs.

◆ DataNormalizationMode()

static DataNormalizationMode QuantConnect.Data.SubscriptionDataConfigExtensions.DataNormalizationMode ( this IEnumerable< SubscriptionDataConfig subscriptionDataConfigs)
static

Extension method used to determine what QuantConnect.DataNormalizationMode to use for a given set of SubscriptionDataConfig

Parameters
subscriptionDataConfigs
Returns
The first DataNormalizationMode, DataNormalizationMode.Adjusted if there are no subscriptions

Definition at line 87 of file SubscriptionDataConfigExtensions.cs.

◆ SetDataNormalizationMode()

static void QuantConnect.Data.SubscriptionDataConfigExtensions.SetDataNormalizationMode ( this IEnumerable< SubscriptionDataConfig subscriptionDataConfigs,
DataNormalizationMode  mode 
)
static

Sets the data normalization mode to be used by this set of SubscriptionDataConfig

Definition at line 100 of file SubscriptionDataConfigExtensions.cs.

◆ TickerShouldBeMapped()

static bool QuantConnect.Data.SubscriptionDataConfigExtensions.TickerShouldBeMapped ( this SubscriptionDataConfig  config)
static

Will determine if mapping should be used for this subscription configuration

Parameters
configThe subscription data configuration we are processing

One of the objectives of this method is to normalize the 'use mapping' check and void code duplication and related issues

Returns
True if ticker should be mapped

Definition at line 117 of file SubscriptionDataConfigExtensions.cs.

◆ PricesShouldBeScaled()

static bool QuantConnect.Data.SubscriptionDataConfigExtensions.PricesShouldBeScaled ( this SubscriptionDataConfig  config,
bool  liveMode = false 
)
static

Will determine if price scaling should be used for this subscription configuration

Parameters
configThe subscription data configuration we are processing

One of the objectives of this method is to normalize the 'use price scale' check and void code duplication and related issues

Parameters
liveModeTrue, is this is a live mode data stream
Returns
True if ticker prices should be scaled

Definition at line 132 of file SubscriptionDataConfigExtensions.cs.

Here is the call graph for this function:

◆ EmitSplitsAndDividends()

static bool QuantConnect.Data.SubscriptionDataConfigExtensions.EmitSplitsAndDividends ( this SubscriptionDataConfig  config)
static

Will determine if splits and dividends should be used for this subscription configuration

Parameters
configThe subscription data configuration we are processing

Different than PricesShouldBeScaled because prices could be scale and no split and dividends really exist, like in the continuous futures case

Returns
True if this configuration requires split and divided handling

Definition at line 158 of file SubscriptionDataConfigExtensions.cs.

◆ GetBaseDataInstance()

static BaseData QuantConnect.Data.SubscriptionDataConfigExtensions.GetBaseDataInstance ( this SubscriptionDataConfig  config)
static

Initializes a new instance of the BaseData type defined in config with the symbol properly set

Definition at line 166 of file SubscriptionDataConfigExtensions.cs.


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