internal void OnLevel2(Level2Snapshot snapshot) { if (this.strategy != null && this.strategy.status == StrategyStatus.Running) { this.strategy.OnLevel2_(snapshot); } }
internal void OnLevel2Snapshot(Level2Snapshot snapshot) { OrderBook orderBook = this.book[snapshot.instrumentId]; if (orderBook == null) { orderBook = new OrderBook(); this.book[snapshot.instrumentId] = orderBook; } orderBook.Set(snapshot); }
public void OnLevel2(Level2Snapshot snapshot) { if (this.orders[snapshot.instrumentId] == null) { return; } for (int i = 0; i < this.orders[snapshot.instrumentId].Count; i++) { Order order = this.orders[snapshot.instrumentId][i]; this.Process(order, this.framework.dataManager.GetOrderBook(order.instrument)); if (this.addQueueToOrderText) { order.Text = order.queueSize.ToString(); } } }
internal virtual void OnLevel2_(Level2Snapshot snapshot) { if (this.raiseEvents && this.instruments.Contains(snapshot.instrumentId)) { this.OnLevel2(this.framework.InstrumentManager.GetById(snapshot.instrumentId), snapshot); } LinkedList <Strategy> linkedList = this.strategiesByInstrument[snapshot.instrumentId]; if (linkedList != null) { for (LinkedListNode <Strategy> linkedListNode = linkedList.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { linkedListNode.Data.OnLevel2_(snapshot); } } }
internal void Set(Level2Snapshot snapshot) { this.bids.Clear(); this.asks.Clear(); Bid[] array = snapshot.bids; for (int i = 0; i < array.Length; i++) { Bid tick = array[i]; this.bids.Add(new Tick(tick)); } Ask[] array2 = snapshot.asks; for (int j = 0; j < array2.Length; j++) { Ask tick2 = array2[j]; this.asks.Add(new Tick(tick2)); } }
private void OnLevel2Snapshot(Event e) { this.data_count += 1L; Level2Snapshot level2Snapshot = (Level2Snapshot)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = level2Snapshot.dateTime; } else { level2Snapshot.dateTime = this.framework.Clock.DateTime; } this.framework.dataManager.OnLevel2Snapshot(level2Snapshot); this.framework.providerManager.executionSimulator.OnLevel2(level2Snapshot); this.framework.strategyManager.OnLevel2(level2Snapshot); }
public override object Read(BinaryReader reader) { Level2Snapshot level2Snapshot = new Level2Snapshot(); reader.ReadByte(); level2Snapshot.dateTime = DateTime.FromBinary(reader.ReadInt64()); level2Snapshot.providerId = reader.ReadByte(); level2Snapshot.instrumentId = reader.ReadInt32(); int num = reader.ReadInt32(); level2Snapshot.bids = new Bid[num]; for (int i = 0; i < num; i++) { level2Snapshot.bids[i] = (Bid)this.streamerManager.Deserialize(reader); } int num2 = reader.ReadInt32(); level2Snapshot.asks = new Ask[num2]; for (int j = 0; j < num2; j++) { level2Snapshot.asks[j] = (Ask)this.streamerManager.Deserialize(reader); } return level2Snapshot; }
public override void Write(BinaryWriter writer, object obj) { Level2Snapshot level2Snapshot = (Level2Snapshot)obj; writer.Write(0); writer.Write(level2Snapshot.dateTime.ToBinary()); writer.Write(level2Snapshot.providerId); writer.Write(level2Snapshot.instrumentId); writer.Write(level2Snapshot.bids.Length); Bid[] bids = level2Snapshot.bids; for (int i = 0; i < bids.Length; i++) { Bid obj2 = bids[i]; this.streamerManager.Serialize(writer, obj2); } writer.Write(level2Snapshot.asks.Length); Ask[] asks = level2Snapshot.asks; for (int j = 0; j < asks.Length; j++) { Ask obj3 = asks[j]; this.streamerManager.Serialize(writer, obj3); } }
public override object Read(BinaryReader reader) { Level2Snapshot level2Snapshot = new Level2Snapshot(); reader.ReadByte(); level2Snapshot.dateTime = DateTime.FromBinary(reader.ReadInt64()); level2Snapshot.providerId = reader.ReadByte(); level2Snapshot.instrumentId = reader.ReadInt32(); int num = reader.ReadInt32(); level2Snapshot.bids = new Bid[num]; for (int i = 0; i < num; i++) { level2Snapshot.bids[i] = (Bid)this.streamerManager.Deserialize(reader); } int num2 = reader.ReadInt32(); level2Snapshot.asks = new Ask[num2]; for (int j = 0; j < num2; j++) { level2Snapshot.asks[j] = (Ask)this.streamerManager.Deserialize(reader); } return(level2Snapshot); }
internal virtual void OnLevel2_(Level2Snapshot snapshot) { if (this.raiseEvents && this.instruments.Contains(snapshot.instrumentId)) { this.OnLevel2(this.framework.InstrumentManager.GetById(snapshot.instrumentId), snapshot); } LinkedList<Strategy> linkedList = this.strategiesByInstrument[snapshot.instrumentId]; if (linkedList != null) { for (LinkedListNode<Strategy> linkedListNode = linkedList.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { linkedListNode.Data.OnLevel2_(snapshot); } } }
protected internal virtual void OnLevel2(Instrument instrument, Level2Snapshot snapshot) { }
public void OnLevel2(Level2Snapshot snapshot) { }
public void OnLevel2(Level2Snapshot snapshot) { throw new NotImplementedException(); }