internal void UpdateMDEntry(MarketDataSnapshotFullRefresh entry, SideController sideController) { MDReqID = entry.getMDReqID().getValue(); ClearGroups(); MDGroupCount = entry.getNoMDEntries().getValue(); MDEntryGroups = new MDEntryGroup[MDGroupCount]; MarketDataSnapshotFullRefresh.NoMDEntries group = new MarketDataSnapshotFullRefresh.NoMDEntries(); for (uint i = 0; i < MDGroupCount; i++) { entry.getGroup(i + 1, group); InsertGroup(i, group, sideController); } IsMDUpdated = true; }
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); }