Ejemplo n.º 1
0
        public static BarCompressor GetCompressor(BarTypeSize barTypeSize, DataSource dataSource)
        {
            BarCompressor barCompressor;

            switch (barTypeSize.BarType)
            {
            case BarType.Time:
                barCompressor = new TimeBarCompressor();
                break;

            case BarType.Tick:
                barCompressor = new TickBarCompressor();
                break;

            case BarType.Volume:
                barCompressor = new VolumeBarCompressor();
                break;

            case BarType.Range:
                barCompressor = new RangeBarCompressor();
                break;

            default:
                throw new ArgumentException(string.Format("Unsupported bar type - {0}", barTypeSize.BarType));
            }
            barCompressor.barSize    = barTypeSize.BarSize;
            barCompressor.dataSource = dataSource;
            return(barCompressor);
        }
Ejemplo n.º 2
0
		public static BarCompressor GetCompressor(BarTypeSize barTypeSize, DataSource dataSource)
		{
			BarCompressor barCompressor;
			switch (barTypeSize.BarType)
			{
				case BarType.Time:
					barCompressor = new TimeBarCompressor();
					break;
				case BarType.Tick:
					barCompressor = new TickBarCompressor();
					break;
				case BarType.Volume:
					barCompressor = new VolumeBarCompressor();
					break;
				case BarType.Range:
					barCompressor = new RangeBarCompressor();
					break;
				default:
					throw new ArgumentException(string.Format("Unsupported bar type - {0}", barTypeSize.BarType));
			}
			barCompressor.barSize = barTypeSize.BarSize;
			barCompressor.dataSource = dataSource;
			return barCompressor;
		}