public OHLCV(BarData barData, int i)
 {
     open   = barData.GetOpen(i);
     close  = barData.GetClose(i);
     low    = barData.GetLow(i);
     high   = barData.GetHigh(i);
     volume = double.IsNaN(barData.GetVolume(i))? 0: barData.GetVolume(i);
     time   = barData.GetTimeUtc(i);
 }
Ejemplo n.º 2
0
        private void Process(int?count = null)
        {
            dailyClose = dailyHistory && dailyBars.Count - 1 >= d?dailyBars.GetClose(d) : double.NaN;

            weeklyClose = weeklyHistory && weeklyBars.Count - 1 >= w?weeklyBars.GetClose(d) : double.NaN;

            monthlyClose = monthlyHistory && monthlyBars.Count - 1 >= m?monthlyBars.GetClose(m) : double.NaN;

            if (count == null)
            {
                this.CalcBar(0);
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    this.CalcBar(i);
                }
            }
        }