Weighteds

定義

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

プロパティ値

DataSeriesオブジェクトを格納する配列

構文

Weighteds[ 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 weighted price to the 5-minute bar's weighted price
     if (Weighteds[0][0] > Weighteds[1][0])
          Print("The current bar's weighted price is greater");
}
最終更新:2014年06月10日 23:32