public override void onMessage(QuickFix42.MarketDataSnapshotFullRefresh marketDataSnapshotFullRefresh, SessionID sessionID) { //Console.WriteLine("marketDataSnapshotFullRefresh " + marketDataSnapshotFullRefresh); uint numberOfEntries = (uint)marketDataSnapshotFullRefresh.getNoMDEntries().getValue(); if (numberOfEntries > 2) { Console.WriteLine("I don't know what to do with more than two price entries. I got " + numberOfEntries + "."); return; } string securityID = marketDataSnapshotFullRefresh.getSecurityID().getValue(); double bidPrice = 0; double bidSize = 0; double askPrice = 0; double askSize = 0; MarketDataSnapshotFullRefresh.NoMDEntries group = new MarketDataSnapshotFullRefresh.NoMDEntries(); for (uint i = 0; i < numberOfEntries; i++) { marketDataSnapshotFullRefresh.getGroup(i + 1, group); if (group.getMDEntryType().getValue() == MDEntryType.BID) { bidPrice = group.getMDEntryPx().getValue(); bidSize = group.getMDEntrySize().getValue(); } if (group.getMDEntryType().getValue() == MDEntryType.OFFER) { askPrice = group.getMDEntryPx().getValue(); askSize = group.getMDEntrySize().getValue(); } } spreadMatrix.Update(securityID, bidPrice, bidSize, askPrice, askSize); }
public override void onMessage(QuickFix42.MarketDataSnapshotFullRefresh marketDataSnapshotFullRefresh, SessionID sessionID) { //AddText("marketDataSnapshotFullRefresh " + marketDataSnapshotFullRefresh + Environment.NewLine); string exchange = marketDataSnapshotFullRefresh.getSecurityExchange().ToString(); string symbol = marketDataSnapshotFullRefresh.getSymbol().ToString(); SpreadMatrixData smd = SpreadMatrixCollection.Get(exchange, symbol); if (smd == null) return; SpreadMatrixCollection.ProcessMessage(exchange, symbol, marketDataSnapshotFullRefresh); SecurityEntry entry = smd.Get(marketDataSnapshotFullRefresh.getSecurityID().getValue()); //testing order //if (entry != null) // ProccessOrder(entry); }