FactorFile
QuantConnect.Data.Auxiliary.FactorFile
FactorFile(
permtick: str,
data: List[QuantConnect_Data_Auxiliary_FactorFile_T],
factor_file_minimum_date: Optional[datetime] = None,
)
Bases: Generic[QuantConnect_Data_Auxiliary_FactorFile_T], Object, IFactorProvider, Iterable[IFactorRow]
Represents an entire factor file for a specified symbol
Initializes a new instance of the FactorFile{T} class.
This codeEntityType is protected.
reversed_factor_file_dates
reversed_factor_file_dates: List[datetime]
Keeping a reversed version is more performant that reversing it each time we need it
This codeEntityType is protected.
sorted_factor_file_data
sorted_factor_file_data: SortedList[
datetime, List[QuantConnect_Data_Auxiliary_FactorFile_T]
]
The factor file data rows sorted by date
factor_file_minimum_date
factor_file_minimum_date: Optional[datetime]
The minimum tradeable date for the symbol
most_recent_factor_change
most_recent_factor_change: datetime
Gets the most recent factor change in the factor file
permtick
permtick: str
Gets the symbol this factor file represents
get_enumerator
get_enumerator() -> IEnumerator[IFactorRow]
Returns an enumerator that iterates through the collection.
Returns:
| Type | Description |
|---|---|
IEnumerator[IFactorRow]
|
A System.Collections.Generic.IEnumerator`1 that can be used to iterate through the collection. |
get_file_format
get_file_format() -> Iterable[str]
Writes this factor file data to an enumerable of csv lines
Returns:
| Type | Description |
|---|---|
Iterable[str]
|
An enumerable of lines representing this factor file. |
get_price_factor
get_price_factor(
search_date: Union[datetime, date],
data_normalization_mode: DataNormalizationMode,
data_mapping_mode: Optional[DataMappingMode] = None,
contract_offset: int = 0,
) -> float
Gets the price scale factor for the specified search date
write_to_file
write_to_file(
symbol: Union[Symbol, str, BaseContract],
) -> None
Write the factor file to the correct place in the default Data folder
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
Union[Symbol, str, BaseContract]
|
The symbol this factor file represents |
required |