Lean
$LEAN_TAG$
|
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... | |
Set of helper methods for factor files and price scaling operations
Definition at line 26 of file PriceScalingExtensions.cs.
|
static |
Resolves the price scale for a date given a factor file and required settings
factorFile | The factor file to use |
dateTime | The date for the price scale lookup |
normalizationMode | The price normalization mode requested |
contractOffset | The contract offset, useful for continuous contracts |
dataMappingMode | The data mapping mode used, useful for continuous contracts |
endDateTime | The reference end date for scaling prices. |
ArgumentException | If 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.
|
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.
|
static |
Helper method to return an empty factor file
Definition at line 91 of file PriceScalingExtensions.cs.
|
static |
Parses the contents as a FactorFile, if error returns a new empty factor file
Definition at line 103 of file PriceScalingExtensions.cs.