예제 #1
0
        private void StartNewBar(Tick tick)
        {
            _barEndTime = tick.TimeStamp.ToIntervalCeiling(SessionIterator.Current.SessionStart, TimeSpan.FromMinutes(_period.PeriodInMinutes));
            _barEndTime = TimeStamp.Min(_barEndTime, SessionIterator.Current.SessionEnd);

            _barInProgress           = new Bar();
            _barInProgress.Open      = _barInProgress.High = _barInProgress.Low = _barInProgress.Close = tick.Price;
            _barInProgress.Volume    = tick.Volume;
            _barInProgress.TimeStamp = _barEndTime;
            Bars.AddNewBar(_barInProgress);
        }