Ejemplo n.º 1
0
		protected override void Add(DataEntry entry)
		{
			if (this.bar == null) this.CreateNewBar(BarType.Volume, entry.DateTime, entry.DateTime, entry.Items[0].Price);

			this.AddItemsToBar(entry.Items);
			this.bar.bar.EndTime = entry.DateTime;
			if (this.bar.Volume < this.newBarSize)
				return;
			this.EmitNewCompressedBar();
			this.bar = null;
		}
Ejemplo n.º 2
0
		protected override void Add(DataEntry entry)
		{
			if (this.bar == null || this.bar.EndTime <= entry.DateTime)
			{
				if (this.bar != null) this.EmitNewCompressedBar();

				DateTime barBeginTime = this.GetBarBeginTime(entry.DateTime);
				DateTime endTime = barBeginTime.AddSeconds(this.newBarSize);
				this.CreateNewBar(BarType.Time, barBeginTime, endTime, entry.Items[0].Price);
			}
			this.AddItemsToBar(entry.Items);
		}
Ejemplo n.º 3
0
		protected override void Add(DataEntry entry)
		{
			if (this.bar == null) this.CreateNewBar(BarType.Tick, entry.DateTime, entry.DateTime, entry.Items[0].Price);

			this.AddItemsToBar(entry.Items);
			this.bar.bar.EndTime = entry.DateTime;
			this.tickCount += this.oldBarSize;
			if (this.tickCount != this.newBarSize)
				return;
			this.EmitNewCompressedBar();
			this.bar = null;
			this.tickCount = 0;
		}
Ejemplo n.º 4
0
		protected override void Add(DataEntry entry)
		{
			double price = entry.Items[0].Price;
			if (this.bar == null)
			{
				base.CreateNewBar(global::OpenQuant.API.BarType.Range, entry.DateTime, entry.DateTime, price);
				return;
			}
			base.AddItemsToBar(entry.Items);
			this.bar.bar.EndTime = entry.DateTime;
			bool flag = false;
			while (!flag)
			{
				if (10000.0 * (this.bar.High - this.bar.Low) >= (double)this.newBarSize)
				{
					global::OpenQuant.API.Bar bar = new global::OpenQuant.API.Bar(new SmartQuant.Data.Bar(SmartQuant.Data.BarType.Range, this.newBarSize, entry.DateTime, entry.DateTime, price, price, price, price, 0L, 0L));
					if (this.bar.High == price)
					{
						this.bar.bar.High = this.bar.Low + (double)this.newBarSize / 10000.0;
						this.bar.bar.Close = this.bar.High;
						bar.bar.Low = this.bar.High;
					}
					if (this.bar.Low == price)
					{
						this.bar.bar.Low = this.bar.High - (double)this.newBarSize / 10000.0;
						this.bar.bar.Close = this.bar.Low;
						bar.bar.High = this.bar.Low;
					}
					base.EmitNewCompressedBar();
					this.bar = bar;
					flag = (10000.0 * (this.bar.High - this.bar.Low) < (double)this.newBarSize);
				}
				else
				{
					flag = true;
				}
			}
		}
Ejemplo n.º 5
0
		protected abstract void Add(DataEntry entry);