Times

定義

ヒストリカル・バーの時間を保持しているTimeSeriesオブジェクトの配列を保持する。独自のストラテジー中でAdd()メソッドを呼び出した時、TimeSeriesオブジェクトはこの配列に加えられる。その目的は、multi-instrumentやmulti-time frameのストラテジーにおいて、全てのBarsオブジェクトの時間へのアクセス方法を提供することである。

プロパティ値

TimeSeriesオブジェクトの配列

構文

Times[ int barSeriesIndex ][ int barsAgo ]

protected override void Initialize()
{
     // Adds a 5-minute Bars object to the strategy and is automatically assigned 
     // a Bars object index of 1 since the primary data the strategy is run against
     // set by the UI takes the index of 0.
     Add(Instrument, PeriodType.Minute, 5);
}
 
protected override void OnBarUpdate()
{
     // Compares the primary bar's time to the 5-minute bar's time
     if (Times[0][0].Ticks > Times[1][0].Ticks)
          Print("The current bar's time is greater");
}
最終更新:2014年06月10日 22:52