Lean  $LEAN_TAG$
QuantConnect.Data.HistoryRequestFactory Class Reference

Helper class used to create new HistoryRequest More...

Public Member Functions

 HistoryRequestFactory (IAlgorithm algorithm)
 Creates a new instance More...
 
HistoryRequest CreateHistoryRequest (SubscriptionDataConfig subscription, DateTime startAlgoTz, DateTime endAlgoTz, SecurityExchangeHours exchangeHours, Resolution? resolution, bool? fillForward=null, bool? extendedMarketHours=null, DataMappingMode? dataMappingMode=null, DataNormalizationMode? dataNormalizationMode=null, int? contractDepthOffset=null)
 Creates a new history request More...
 
DateTime GetStartTimeAlgoTz (Symbol symbol, int periods, Resolution resolution, SecurityExchangeHours exchange, DateTimeZone dataTimeZone, Type dataType, bool? extendedMarketHours=null)
 Gets the start time required for the specified bar count in terms of the algorithm's time zone More...
 
DateTime GetStartTimeAlgoTz (DateTime referenceUtcTime, Symbol symbol, int periods, Resolution resolution, SecurityExchangeHours exchange, DateTimeZone dataTimeZone, Type dataType, bool? extendedMarketHours=null)
 Gets the start time required for the specified bar count in terms of the algorithm's time zone More...
 

Detailed Description

Helper class used to create new HistoryRequest

Definition at line 27 of file HistoryRequestFactory.cs.

Constructor & Destructor Documentation

◆ HistoryRequestFactory()

QuantConnect.Data.HistoryRequestFactory.HistoryRequestFactory ( IAlgorithm  algorithm)

Creates a new instance

Parameters
algorithmThe algorithm instance to use

Definition at line 35 of file HistoryRequestFactory.cs.

Member Function Documentation

◆ CreateHistoryRequest()

HistoryRequest QuantConnect.Data.HistoryRequestFactory.CreateHistoryRequest ( SubscriptionDataConfig  subscription,
DateTime  startAlgoTz,
DateTime  endAlgoTz,
SecurityExchangeHours  exchangeHours,
Resolution resolution,
bool?  fillForward = null,
bool?  extendedMarketHours = null,
DataMappingMode dataMappingMode = null,
DataNormalizationMode dataNormalizationMode = null,
int?  contractDepthOffset = null 
)

Creates a new history request

Parameters
subscriptionThe config
startAlgoTzHistory request start time in algorithm time zone
endAlgoTzHistory request end time in algorithm time zone
exchangeHoursSecurity exchange hours
resolutionThe resolution to use. If null will use SubscriptionDataConfig.Resolution
fillForwardTrue to fill forward missing data, false otherwise
extendedMarketHoursTrue to include extended market hours data, false otherwise
dataMappingModeThe contract mapping mode to use for the security history request
dataNormalizationModeThe price scaling mode to use for the securities history
contractDepthOffsetThe continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
Returns
The new HistoryRequest

Definition at line 55 of file HistoryRequestFactory.cs.

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

◆ GetStartTimeAlgoTz() [1/2]

DateTime QuantConnect.Data.HistoryRequestFactory.GetStartTimeAlgoTz ( Symbol  symbol,
int  periods,
Resolution  resolution,
SecurityExchangeHours  exchange,
DateTimeZone  dataTimeZone,
Type  dataType,
bool?  extendedMarketHours = null 
)

Gets the start time required for the specified bar count in terms of the algorithm's time zone

Parameters
symbolThe symbol to select proper SubscriptionDataConfig config
periodsThe number of bars requested
resolutionThe length of each bar
exchangeThe exchange hours used for market open hours
dataTimeZoneThe time zone in which data are stored
dataTypeThe data type to request
extendedMarketHoursTrue to include extended market hours data, false otherwise. If not passed, the config will be used to determined whether to include extended market hours.
Returns
The start time that would provide the specified number of bars ending at the algorithm's current time

Definition at line 131 of file HistoryRequestFactory.cs.

Here is the caller graph for this function:

◆ GetStartTimeAlgoTz() [2/2]

DateTime QuantConnect.Data.HistoryRequestFactory.GetStartTimeAlgoTz ( DateTime  referenceUtcTime,
Symbol  symbol,
int  periods,
Resolution  resolution,
SecurityExchangeHours  exchange,
DateTimeZone  dataTimeZone,
Type  dataType,
bool?  extendedMarketHours = null 
)

Gets the start time required for the specified bar count in terms of the algorithm's time zone

Parameters
referenceUtcTimeThe end time in utc
symbolThe symbol to select proper SubscriptionDataConfig config
periodsThe number of bars requested
resolutionThe length of each bar
exchangeThe exchange hours used for market open hours
dataTimeZoneThe time zone in which data are stored
dataTypeThe data type to request
extendedMarketHoursTrue to include extended market hours data, false otherwise. If not passed, the config will be used to determined whether to include extended market hours.
Returns
The start time that would provide the specified number of bars ending at the algorithm's current time

Definition at line 158 of file HistoryRequestFactory.cs.

Here is the call graph for this function:

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