Ejemplo n.º 1
0
        public static BarCompressor GetCompressor(BarType barType, long oldBarSize, long newBarSize)
        {
            BarCompressor barCompressor;

            switch (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("Unknown bar type - {0}", barType));
            }
            barCompressor.oldBarSize = oldBarSize;
            barCompressor.newBarSize = newBarSize;
            return(barCompressor);
        }
Ejemplo n.º 2
0
		public static BarCompressor GetCompressor(global::OpenQuant.API.BarType barType, long oldBarSize, long newBarSize)
		{
			BarCompressor barCompressor;
			switch (barType)
			{
			case global::OpenQuant.API.BarType.Time:
				barCompressor = new TimeBarCompressor();
				break;
			case global::OpenQuant.API.BarType.Tick:
				barCompressor = new TickBarCompressor();
				break;
			case global::OpenQuant.API.BarType.Volume:
				barCompressor = new VolumeBarCompressor();
				break;
			case global::OpenQuant.API.BarType.Range:
				barCompressor = new RangeBarCompressor();
				break;
			default:
				throw new ArgumentException(string.Format("Unknown bar type - {0}", barType));
			}
			barCompressor.oldBarSize = oldBarSize;
			barCompressor.newBarSize = newBarSize;
			return barCompressor;
		}