Ejemplo 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();
            }
        }
Ejemplo n.º 2
0
        protected override sealed void OnTermination()
        {
            GomOnTermination();

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

			if (fm != null)
			{
				fm.Dispose();
				fm = null;
			}
		}
Ejemplo n.º 5
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();
			}
		}
Ejemplo n.º 6
0
		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();
		}