public void Initialize(string instrName, bool writeData, GomRecorderIndicator indy)
		{
			freereader();
			
			_InstrName = instrName;

		}
예제 #2
0
        /// <summary>
        /// Base Recorder indicator class. Can be instantiated or not
        /// </summary>
        /// <returns></returns>
        public GomRecorderIndicator GomRecorderIndicator(Data.IDataSeries input, string fileFormat)
        {
            if (cacheGomRecorderIndicator != null)
            {
                for (int idx = 0; idx < cacheGomRecorderIndicator.Length; idx++)
                {
                    if (cacheGomRecorderIndicator[idx].FileFormat == fileFormat && cacheGomRecorderIndicator[idx].EqualsInput(input))
                    {
                        return(cacheGomRecorderIndicator[idx]);
                    }
                }
            }

            lock (checkGomRecorderIndicator)
            {
                checkGomRecorderIndicator.FileFormat = fileFormat;
                fileFormat = checkGomRecorderIndicator.FileFormat;

                if (cacheGomRecorderIndicator != null)
                {
                    for (int idx = 0; idx < cacheGomRecorderIndicator.Length; idx++)
                    {
                        if (cacheGomRecorderIndicator[idx].FileFormat == fileFormat && cacheGomRecorderIndicator[idx].EqualsInput(input))
                        {
                            return(cacheGomRecorderIndicator[idx]);
                        }
                    }
                }

                GomRecorderIndicator indicator = new GomRecorderIndicator();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input      = input;
                indicator.FileFormat = fileFormat;
                Indicators.Add(indicator);
                indicator.SetUp();

                GomRecorderIndicator[] tmp = new GomRecorderIndicator[cacheGomRecorderIndicator == null ? 1 : cacheGomRecorderIndicator.Length + 1];
                if (cacheGomRecorderIndicator != null)
                {
                    cacheGomRecorderIndicator.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1]       = indicator;
                cacheGomRecorderIndicator = tmp;
                return(indicator);
            }
        }
		public void Initialize(string instrName, bool writeData, GomRecorderIndicator indy)
		{
			freereader();
			
			_tickSize = indy.BarsArray[0].Instrument.MasterInstrument.TickSize;
			_InstrName = instrName;
			_writeData = writeData;
			
			if (IsWritable)
				_fileMode = indy.FileMode;
			else
				_fileMode = Gom.FileModeType.SingleFile;

            _useMillisec = indy.useMillisec;
		}
        /// <summary>
        /// Base Recorder indicator class. Can be instantiated or not
        /// </summary>
        /// <returns></returns>
        public GomRecorderIndicator GomRecorderIndicator(Data.IDataSeries input, string fileFormat)
        {
            if (cacheGomRecorderIndicator != null)
                for (int idx = 0; idx < cacheGomRecorderIndicator.Length; idx++)
                    if (cacheGomRecorderIndicator[idx].FileFormat == fileFormat && cacheGomRecorderIndicator[idx].EqualsInput(input))
                        return cacheGomRecorderIndicator[idx];

            lock (checkGomRecorderIndicator)
            {
                checkGomRecorderIndicator.FileFormat = fileFormat;
                fileFormat = checkGomRecorderIndicator.FileFormat;

                if (cacheGomRecorderIndicator != null)
                    for (int idx = 0; idx < cacheGomRecorderIndicator.Length; idx++)
                        if (cacheGomRecorderIndicator[idx].FileFormat == fileFormat && cacheGomRecorderIndicator[idx].EqualsInput(input))
                            return cacheGomRecorderIndicator[idx];

                GomRecorderIndicator indicator = new GomRecorderIndicator();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.FileFormat = fileFormat;
                Indicators.Add(indicator);
                indicator.SetUp();

                GomRecorderIndicator[] tmp = new GomRecorderIndicator[cacheGomRecorderIndicator == null ? 1 : cacheGomRecorderIndicator.Length + 1];
                if (cacheGomRecorderIndicator != null)
                    cacheGomRecorderIndicator.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheGomRecorderIndicator = tmp;
                return indicator;
            }
        }