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(); } }
protected override sealed void OnTermination() { GomOnTermination(); if (fm != null) { fm.Dispose(); fm = null; } }