Lean  $LEAN_TAG$
QuantConnect.Data.Auxiliary.PriceScalingExtensions Class Reference

Set of helper methods for factor files and price scaling operations More...

Static Public Member Functions

static decimal GetPriceScale (this IFactorProvider factorFile, DateTime dateTime, DataNormalizationMode normalizationMode, uint contractOffset=0, DataMappingMode? dataMappingMode=null, DateTime? endDateTime=null)
 Resolves the price scale for a date given a factor file and required settings More...
 
static Symbol GetFactorFileSymbol (this Symbol symbol)
 Determines the symbol to use to fetch it's factor file More...
 
static IFactorProvider GetEmptyFactorFile (this Symbol symbol)
 Helper method to return an empty factor file More...
 
static IFactorProvider SafeRead (string permtick, IEnumerable< string > contents, SecurityType securityType)
 Parses the contents as a FactorFile, if error returns a new empty factor file More...
 

Detailed Description

Set of helper methods for factor files and price scaling operations

Definition at line 26 of file PriceScalingExtensions.cs.

Member Function Documentation

◆ GetPriceScale()

static decimal QuantConnect.Data.Auxiliary.PriceScalingExtensions.GetPriceScale ( this IFactorProvider  factorFile,
DateTime  dateTime,
DataNormalizationMode  normalizationMode,
uint  contractOffset = 0,
DataMappingMode dataMappingMode = null,
DateTime?  endDateTime = null 
)
static

Resolves the price scale for a date given a factor file and required settings

Parameters
factorFileThe factor file to use
dateTimeThe date for the price scale lookup
normalizationModeThe price normalization mode requested
contractOffsetThe contract offset, useful for continuous contracts
dataMappingModeThe data mapping mode used, useful for continuous contracts
endDateTimeThe reference end date for scaling prices.
Returns
The price scale to use
Exceptions
ArgumentExceptionIf normalizationMode is DataNormalizationMode.ScaledRaw and endDateTime is null

For DataNormalizationMode.ScaledRaw normalization mode, the prices are scaled to the prices on the endDateTime

Definition at line 45 of file PriceScalingExtensions.cs.

Here is the call graph for this function:

◆ GetFactorFileSymbol()

static Symbol QuantConnect.Data.Auxiliary.PriceScalingExtensions.GetFactorFileSymbol ( this Symbol  symbol)
static

Determines the symbol to use to fetch it's factor file

This is useful for futures where the symbol to use is the canonical

Definition at line 83 of file PriceScalingExtensions.cs.

◆ GetEmptyFactorFile()

static IFactorProvider QuantConnect.Data.Auxiliary.PriceScalingExtensions.GetEmptyFactorFile ( this Symbol  symbol)
static

Helper method to return an empty factor file

Definition at line 91 of file PriceScalingExtensions.cs.

◆ SafeRead()

static IFactorProvider QuantConnect.Data.Auxiliary.PriceScalingExtensions.SafeRead ( string  permtick,
IEnumerable< string >  contents,
SecurityType  securityType 
)
static

Parses the contents as a FactorFile, if error returns a new empty factor file

Definition at line 103 of file PriceScalingExtensions.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: