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; } }
protected override sealed void OnStartUp() { if (BarsPeriod.Id == PeriodType.Volume) { MaxVolume = BarsPeriod.Value; } if (BarsPeriod.Id == PeriodType.Tick) { MaxTick = BarsPeriod.Value; } fm = (Gom.IDataManager)Activator.CreateInstance(Gom.DataManagerList.Type[iDataManager]); fm.Initialize(BarsArray[0].Instrument.FullName, writeData, this); GomOnStartUp(); }
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 OnStartUp() { if (BarsPeriod.Id == PeriodType.Volume) MaxVolume = BarsPeriod.Value; if (BarsPeriod.Id == PeriodType.Tick) MaxTick = BarsPeriod.Value; fm = (Gom.IDataManager)Activator.CreateInstance(Gom.DataManagerList.Type[iDataManager]); fm.Initialize(BarsArray[0].Instrument.FullName, writeData, this); GomOnStartUp(); }