public override void Add(CompressorDataItem data) { if (this.bar == null) this.CreateNewBar(BarType.Volume, data.DateTime, data.DateTime, data.Items[0].Price); this.AddDataToBar(data.Items); this.bar.EndTime = data.DateTime; if (this.bar.Volume < this.barSize) return; this.EmitNewCompressedBar(); this.bar = null; }
public override void Add(CompressorDataItem data) { if (this.bar == null || this.bar.EndTime <= data.DateTime) { if (this.bar != null) this.EmitNewCompressedBar(); DateTime barBeginTime = this.GetBarBeginTime(data.DateTime); this.CreateNewBar(BarType.Time, barBeginTime, barBeginTime.AddSeconds(this.barSize), data.Items[0].Price); this.AddDataToBar(data.Items); } else this.AddDataToBar(data.Items); }
public override void Add(CompressorDataItem data) { if (this.bar == null) { this.CreateNewBar(BarType.Volume, data.DateTime, data.DateTime, data.Items[0].Price); } this.AddDataToBar(data.Items); this.bar.EndTime = data.DateTime; if (this.bar.Volume < this.barSize) { return; } this.EmitNewCompressedBar(); this.bar = null; }
public override void Add(CompressorDataItem data) { if (this.bar == null) this.CreateNewBar(BarType.Tick, data.DateTime, data.DateTime, data.Items[0].Price); this.AddDataToBar(data.Items); this.bar.EndTime = data.DateTime; if (this.dataSource.Input == DataSourceInput.Bar) this.tickCount += ((BarDataSource)this.dataSource).BarSize; else ++this.tickCount; if (this.tickCount != this.barSize) return; this.EmitNewCompressedBar(); this.bar = null; this.tickCount = 0; }
public override void Add(CompressorDataItem data) { if (this.bar == null || this.bar.EndTime <= data.DateTime) { if (this.bar != null) { this.EmitNewCompressedBar(); } DateTime barBeginTime = this.GetBarBeginTime(data.DateTime); this.CreateNewBar(BarType.Time, barBeginTime, barBeginTime.AddSeconds(this.barSize), data.Items[0].Price); this.AddDataToBar(data.Items); } else { this.AddDataToBar(data.Items); } }
public override void Add(CompressorDataItem data) { if (data.Items.Count != 1) { throw new ArgumentException(string.Format("Cannot make range bars from {0}", (object)this.dataSource.Input)); } double price = data.Items[0].Price; if (this.bar == null) { this.CreateNewBar((BarType)4, data.DateTime, data.DateTime, price); } else { this.AddDataToBar(data.Items); this.bar.EndTime = data.DateTime; bool flag = false; while (!flag) { if (10000.0 * (this.bar.High - this.bar.Low) >= (double)this.barSize) { Bar bar = new Bar(BarType.Range, this.barSize, data.DateTime, data.DateTime, price, price, price, price, 0, 0); if (this.bar.High == price) { this.bar.High = this.bar.Low + (double)this.barSize / 10000.0; this.bar.Close = this.bar.High; bar.Low = this.bar.High; } if (this.bar.Low == price) { this.bar.Low = this.bar.High - (double)this.barSize / 10000.0; this.bar.Close = this.bar.Low; bar.High = this.bar.Low; } this.EmitNewCompressedBar(); this.bar = bar; flag = 10000.0 * (this.bar.High - this.bar.Low) < (double)this.barSize; } else { flag = true; } } } }
public override void Add(CompressorDataItem data) { if (data.Items.Count != 1) throw new ArgumentException(string.Format("Cannot make range bars from {0}", (object)this.dataSource.Input)); double price = data.Items[0].Price; if (this.bar == null) { this.CreateNewBar((BarType)4, data.DateTime, data.DateTime, price); } else { this.AddDataToBar(data.Items); this.bar.EndTime = data.DateTime; bool flag = false; while (!flag) { if (10000.0 * (this.bar.High - this.bar.Low) >= (double)this.barSize) { Bar bar = new Bar(BarType.Range, this.barSize, data.DateTime, data.DateTime, price, price, price, price, 0, 0); if (this.bar.High == price) { this.bar.High = this.bar.Low + (double)this.barSize / 10000.0; this.bar.Close = this.bar.High; bar.Low = this.bar.High; } if (this.bar.Low == price) { this.bar.Low = this.bar.High - (double)this.barSize / 10000.0; this.bar.Close = this.bar.Low; bar.High = this.bar.Low; } this.EmitNewCompressedBar(); this.bar = bar; flag = 10000.0 * (this.bar.High - this.bar.Low) < (double)this.barSize; } else flag = true; } } }
public override void Add(CompressorDataItem data) { if (this.bar == null) { this.CreateNewBar(BarType.Tick, data.DateTime, data.DateTime, data.Items[0].Price); } this.AddDataToBar(data.Items); this.bar.EndTime = data.DateTime; if (this.dataSource.Input == DataSourceInput.Bar) { this.tickCount += ((BarDataSource)this.dataSource).BarSize; } else { ++this.tickCount; } if (this.tickCount != this.barSize) { return; } this.EmitNewCompressedBar(); this.bar = null; this.tickCount = 0; }
public abstract void Add(CompressorDataItem data);
public abstract void Add(CompressorDataItem data);