public void UpdateMarketData(MKT_MESSAGE Message) { if (Message.Type == MKT_MESSAGE.MessageType.BOTH) { this.Ask = Message.Ask; this.Bid = Message.Bid; } else if (Message.Type == MKT_MESSAGE.MessageType.ASK_ONLY) { this.Ask = Message.Ask; } else if (Message.Type == MKT_MESSAGE.MessageType.BID_ONLY) { this.Bid = Message.Bid; } else if (Message.Type == MKT_MESSAGE.MessageType.ASK_WITH_SIZE) { this.Ask = Message.Ask; this.Ask_Size = Message.Ask_Size; } else if (Message.Type == MKT_MESSAGE.MessageType.BID_WITH_SIZE) { this.Bid = Message.Bid; this.Bid_Size = Message.Bid_Size; } else if (Message.Type == MKT_MESSAGE.MessageType.BOTH_WITH_SIZE) { this.Ask = Message.Ask; this.Ask_Size = Message.Ask_Size; this.Bid = Message.Bid; this.Bid_Size = Message.Bid_Size; } }
public void UpdateBidSize(int tickerId, int size) { Asset theAsset = dicAssetTickerID[tickerId]; MKT_MESSAGE newMessage = new MKT_MESSAGE(); newMessage.Type = MKT_MESSAGE.MessageType.BID_WITH_SIZE; newMessage.Bid = theAsset.Bid; newMessage.Bid_Size = size; theAsset.UpdateMarketData(newMessage); DoBroadCast(theAsset); }
public void UpdateMKTBid(int tickerId, int position, double price, int size) { Asset theAsset = dicAssetTickerID[tickerId]; MKT_MESSAGE newMessage = new MKT_MESSAGE(); newMessage.Type = MKT_MESSAGE.MessageType.BID_ONLY; newMessage.Bid = Convert.ToDecimal(price); //newMessage.Bid_Size = size; theAsset.UpdateMarketData(newMessage); DoBroadCast(theAsset); }