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

Defines a single row in a factor_factor file. This is a csv file ordered as {date, price factor, split factor, reference price} More...

Inheritance diagram for QuantConnect.Data.Auxiliary.CorporateFactorRow:
[legend]

Public Member Functions

 CorporateFactorRow (DateTime date, decimal priceFactor, decimal splitFactor, decimal referencePrice=0)
 Initializes a new instance of the CorporateFactorRow class More...
 
CorporateFactorRow Apply (Dividend dividend, SecurityExchangeHours exchangeHours)
 Applies the dividend to this factor file row. This dividend date must be on or before the factor file row date More...
 
CorporateFactorRow Apply (Split split, SecurityExchangeHours exchangeHours)
 Applies the split to this factor file row. This split date must be on or before the factor file row date More...
 
Dividend GetDividend (CorporateFactorRow nextCorporateFactorRow, Symbol symbol, SecurityExchangeHours exchangeHours, int decimalPlaces=2)
 Creates a new dividend from this factor file row and the one chronologically in front of it This dividend may have a distribution of zero if this row doesn't represent a dividend More...
 
Split GetSplit (CorporateFactorRow nextCorporateFactorRow, Symbol symbol, SecurityExchangeHours exchangeHours)
 Creates a new split from this factor file row and the one chronologically in front of it This split may have a split factor of one if this row doesn't represent a split More...
 
string GetFileFormat (string source=null)
 Writes factor file row into it's file format More...
 
override string ToString ()
 Returns a string that represents the current object. More...
 

Static Public Member Functions

static List< CorporateFactorRowParse (IEnumerable< string > lines, out DateTime? factorFileMinimumDate)
 Parses the lines as factor files rows while properly handling inf entries More...
 

Properties

DateTime Date [get]
 Gets the date associated with this data More...
 
decimal PriceFactor [get, set]
 Gets the price factor associated with this data More...
 
decimal SplitFactor [get, set]
 Gets the split factor associated with the date More...
 
decimal PriceScaleFactor [get]
 Gets the combined factor used to create adjusted prices from raw prices More...
 
decimal ReferencePrice [get]
 Gets the raw closing value from the trading date before the updated factor takes effect More...
 
- Properties inherited from QuantConnect.Data.Auxiliary.IFactorRow
DateTime Date [get]
 Gets the date associated with this data More...
 

Detailed Description

Defines a single row in a factor_factor file. This is a csv file ordered as {date, price factor, split factor, reference price}

Definition at line 30 of file CorporateFactorRow.cs.

Constructor & Destructor Documentation

◆ CorporateFactorRow()

QuantConnect.Data.Auxiliary.CorporateFactorRow.CorporateFactorRow ( DateTime  date,
decimal  priceFactor,
decimal  splitFactor,
decimal  referencePrice = 0 
)

Initializes a new instance of the CorporateFactorRow class

Definition at line 86 of file CorporateFactorRow.cs.

Here is the caller graph for this function:

Member Function Documentation

◆ Parse()

static List<CorporateFactorRow> QuantConnect.Data.Auxiliary.CorporateFactorRow.Parse ( IEnumerable< string >  lines,
out DateTime?  factorFileMinimumDate 
)
static

Parses the lines as factor files rows while properly handling inf entries

Parameters
linesThe lines from the factor file to be parsed
factorFileMinimumDateThe minimum date from the factor file
Returns
An enumerable of factor file rows

Definition at line 100 of file CorporateFactorRow.cs.

Here is the caller graph for this function:

◆ Apply() [1/2]

CorporateFactorRow QuantConnect.Data.Auxiliary.CorporateFactorRow.Apply ( Dividend  dividend,
SecurityExchangeHours  exchangeHours 
)

Applies the dividend to this factor file row. This dividend date must be on or before the factor file row date

Parameters
dividendThe dividend to apply with reference price and distribution specified
exchangeHoursExchange hours used for resolving the previous trading day
Returns
A new factor file row that applies the dividend to this row's factors

Definition at line 142 of file CorporateFactorRow.cs.

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

◆ Apply() [2/2]

CorporateFactorRow QuantConnect.Data.Auxiliary.CorporateFactorRow.Apply ( Split  split,
SecurityExchangeHours  exchangeHours 
)

Applies the split to this factor file row. This split date must be on or before the factor file row date

Parameters
splitThe split to apply with reference price and split factor specified
exchangeHoursExchange hours used for resolving the previous trading day
Returns
A new factor file row that applies the split to this row's factors

Definition at line 180 of file CorporateFactorRow.cs.

Here is the call graph for this function:

◆ GetDividend()

Dividend QuantConnect.Data.Auxiliary.CorporateFactorRow.GetDividend ( CorporateFactorRow  nextCorporateFactorRow,
Symbol  symbol,
SecurityExchangeHours  exchangeHours,
int  decimalPlaces = 2 
)

Creates a new dividend from this factor file row and the one chronologically in front of it This dividend may have a distribution of zero if this row doesn't represent a dividend

Parameters
nextCorporateFactorRowThe next factor file row in time
symbolThe symbol to use for the dividend
exchangeHoursExchange hours used for resolving the previous trading day
decimalPlacesThe number of decimal places to round the dividend's distribution to, defaulting to 2
Returns
A new dividend instance

Definition at line 220 of file CorporateFactorRow.cs.

Here is the call graph for this function:

◆ GetSplit()

Split QuantConnect.Data.Auxiliary.CorporateFactorRow.GetSplit ( CorporateFactorRow  nextCorporateFactorRow,
Symbol  symbol,
SecurityExchangeHours  exchangeHours 
)

Creates a new split from this factor file row and the one chronologically in front of it This split may have a split factor of one if this row doesn't represent a split

Parameters
nextCorporateFactorRowThe next factor file row in time
symbolThe symbol to use for the split
exchangeHoursExchange hours used for resolving the previous trading day
Returns
A new split instance

Definition at line 249 of file CorporateFactorRow.cs.

Here is the call graph for this function:

◆ GetFileFormat()

string QuantConnect.Data.Auxiliary.CorporateFactorRow.GetFileFormat ( string  source = null)

Writes factor file row into it's file format

CSV formatted

Implements QuantConnect.Data.Auxiliary.IFactorRow.

Definition at line 288 of file CorporateFactorRow.cs.

◆ ToString()

override string QuantConnect.Data.Auxiliary.CorporateFactorRow.ToString ( )

Returns a string that represents the current object.

Returns
A string that represents the current object.

<filterpriority>2</filterpriority>

Definition at line 305 of file CorporateFactorRow.cs.

Property Documentation

◆ Date

DateTime QuantConnect.Data.Auxiliary.CorporateFactorRow.Date
get

Gets the date associated with this data

Definition at line 38 of file CorporateFactorRow.cs.

◆ PriceFactor

decimal QuantConnect.Data.Auxiliary.CorporateFactorRow.PriceFactor
getset

Gets the price factor associated with this data

Definition at line 44 of file CorporateFactorRow.cs.

◆ SplitFactor

decimal QuantConnect.Data.Auxiliary.CorporateFactorRow.SplitFactor
getset

Gets the split factor associated with the date

Definition at line 61 of file CorporateFactorRow.cs.

◆ PriceScaleFactor

decimal QuantConnect.Data.Auxiliary.CorporateFactorRow.PriceScaleFactor
get

Gets the combined factor used to create adjusted prices from raw prices

Definition at line 76 of file CorporateFactorRow.cs.

◆ ReferencePrice

decimal QuantConnect.Data.Auxiliary.CorporateFactorRow.ReferencePrice
get

Gets the raw closing value from the trading date before the updated factor takes effect

Definition at line 81 of file CorporateFactorRow.cs.


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