Exemplo n.º 1
0
        protected override sealed void OnBarUpdate()
        {
            GomOnBarUpdate();

            if (BarsInProgress == 0)
            {
                if (Historical)
                {
                    MasterInstrument MI = Bars.Instrument.MasterInstrument;
                    if ((Bars.FirstBarOfSession || (BarsPeriod.Id == PeriodType.Day)) && (MI.InstrumentType == InstrumentType.Future) && (MI.MergePolicy != MergePolicy.DoNotMerge) && !writeData && !Bars.Instrument.FullName.Contains("##-##"))
                    {
                        RolloverContract();
                    }

                    OnBarUpdateHistorical();
                }

                else
                {
                    if (dataManagerNotDisposedOf)
                    {
                        if (!writeData)
                        {
                            fm.Dispose();
                            fm = null;
                            dataManagerNotDisposedOf = false;
                        }
                    }

                    OnBarUpdateRealTime();
                }

                GomOnBarUpdateDone();
            }
        }
Exemplo n.º 2
0
        protected override sealed void OnTermination()
        {
            GomOnTermination();

            if (fm != null)
            {
                fm.Dispose();
                fm = null;
            }
        }