public void Add(Tick tick) { _countTicks++; bool flagNewMapItem = false; if (_countMapItem == 0) { flagNewMapItem = true; } else { long sec1 = tick.Time / 10000000L; long sec2 = _mapItem.Time / 10000000L; flagNewMapItem = sec1 / TIME_FRAME_SECOND - sec2 / TIME_FRAME_SECOND > 0; } if (flagNewMapItem) { this.SaveCurrentBar(); _mapItem = new TicksMapItem(tick.Time, 1); _countMapItem++; } else { _mapItem.CountTick++; } }
public void Write(TicksMapItem map, int index) { lock (Locked) { this.CheckWriterOffset(index); Write(new DateTime(map.Time)); Writer.Write(map.CountTick); } }