Beispiel #1
0
		public void Add(Instrument instrument, BarType barType, long barSize)
		{
			BarFactoryItem item;
			switch (barType)
			{
			case BarType.Time:
				item = new TimeBarFactoryItem(instrument, barSize);
				break;
			case BarType.Tick:
				item = new TickBarFactoryItem(instrument, barSize);
				break;
			case BarType.Volume:
				item = new VolumeBarFactoryItem(instrument, barSize);
				break;
			default:
				throw new ArgumentException(string.Format("Unknown bar type - {0}", barType));
			}
			this.Add(item);
		}
Beispiel #2
0
        public void Add(Instrument instrument, BarType barType, long barSize)
        {
            BarFactoryItem item;

            switch (barType)
            {
            case BarType.Time:
                item = new TimeBarFactoryItem(instrument, barSize);
                break;

            case BarType.Tick:
                item = new TickBarFactoryItem(instrument, barSize);
                break;

            case BarType.Volume:
                item = new VolumeBarFactoryItem(instrument, barSize);
                break;

            default:
                throw new ArgumentException(string.Format("Unknown bar type - {0}", barType));
            }
            this.Add(item);
        }