GetInitialLookBackDays()
<< Click to Display Table of Contents >> GetInitialLookBackDays() |
Determines how many days of data load when a user makes a "bars back" data request.
This method returns an int value.
barsPeriod |
The bars period chosen by the user when utilizing this Bars type |
tradingHours |
The trading hours chosen by the user when utilizing this Bars type |
barsBack |
The bars back chosen by the user when utilizing this Bars type |
public override int GetInitialLookBackDays(BarsPeriod barsPeriod, TradingHours tradingHours, int barsBack)
{
}
public override int GetInitialLookBackDays(BarsPeriod barsPeriod, TradingHours tradingHours, int barsBack) { // Returns the minimum number of days needed to successfully load the number // of bars back requested for a monthly Bars type return (int) barsPeriod.Value * barsBack * 31; } |
Tip: Try to request an amount of data that is just right for what is needed. Requesting too large a data set will result in unnecessary data being loaded. Requesting too small a data set will result in multiple requests being done. |