BuiltFrom

View as Markdown

Definition

Determines the base dataset used to build the BarsType (i.e., Tick, Minute, Day). The BuiltFrom property will control the frequency in which OnDataPoint() processes historical data.

Property Value

A BarsPeriodType enum. Values that will be recognized include:

  • BarsPeriodType.Tick
  • BarsPeriodType.Minute
  • BarsPeriodType.Day

Warning: Using other bars period types (e.g., Range, Volume, or other custom bars types) is NOT supported. The BarsPeriodType values mentioned above represent all of the fundamental data points needed to build a bar.

Syntax

BuiltFrom

Examples

1protected override void OnStateChange()
2{
3 if (State == State.SetDefaults)
4 {
5 Name = "MyCustomBarsType";
6 BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 15, BarsPeriodTypeName = "MyCustomBarsType(15)", Value = 1 };
7 BuiltFrom = BarsPeriodType.Minute; // update OnDataPoint() every minute on historical data
8 DaysToLoad = 5;
9 }
10
11 else if (State == State.Configure)
12 {
13 }
14}