OnBarOpen() private method

private OnBarOpen ( Bar bar ) : bool
bar Bar
return bool
示例#1
0
        // TODO: rewrite it
        private void OnBar(Event e)
        {
            DataEventCount++;
            var bar = (Bar)e;

            if (this.framework.Clock.Mode == ClockMode.Simulation)
            {
                this.framework.Clock.DateTime = bar.DateTime;
            }

            if (bar.Status != BarStatus.Open)
            {
                this.framework.DataManager.OnBar(bar);
                this.framework.InstrumentManager.GetById(bar.InstrumentId).Bar = bar;
                this.framework.ProviderManager.ExecutionSimulator.OnBar(bar);
                this.framework.StrategyManager.OnBar(bar);

                if (bar.Type == BarType.Time || bar.Type == BarType.Session)
                {
                    BarSliceFactory.OnBar(bar);
                }

                return;
            }

            if ((bar.Type == BarType.Time || bar.Type == BarType.Session) && !BarSliceFactory.OnBarOpen(bar))
            {
                return;
            }
            this.framework.ProviderManager.ExecutionSimulator.OnBarOpen(bar);
            this.framework.StrategyManager.OnBarOpen(bar);
        }