[Quickfix-developers] weird code
Brought to you by:
orenmnero
From: azmat <mr...@gm...> - 2008-03-04 20:50:00
|
All, I am nicely moving along creating my first ever FIX app and would like to thank everyone in helping me with this journey. I am now able to send market data messages, however have problems with the Snapshot / Full Refresh messages that are returned. This is what I wrote. I based it off of what was written in the documentation (http://quickfixengine.org/quickfix/doc/html/csharp/repeating_groups_2.html) int iGroup = Int32.Parse(mdsfr.get(new NoMDEntries()).ToString()); QuickFix42.MarketDataSnapshotFullRefresh.NoMDEntries mdGroup = new QuickFix42.MarketDataSnapshotFullRefresh.NoMDEntries(); MDEntryType entryType = new MDEntryType(); MDEntryPx entryPrice = new MDEntryPx(); MDEntrySize entrySize = new MDEntrySize(); for(uint i=0; i<iGroup; i++) { mdsfr.getGroup(i, mdGroup); // what does this line do?? if (mdGroup.get(new MDEntryType()).ToString() == "0") //bid { MarketDepthData md = new MarketDepthData(Int32.Parse(mdGroup.get(new MDEntrySize()).ToString()), mdGroup.get(new MDEntryPx()).ToString()); mdupdate.bidList.Add(md.Price, md); } else if (mdGroup.get(new MDEntryType()).ToString() == "1") //sell { MarketDepthData md = new MarketDepthData(Int32.Parse(mdGroup.get(new MDEntrySize()).ToString()), mdGroup.get(new MDEntryPx()).ToString()); mdupdate.askList.Add(md.Price, md); } else //trade { mdupdate.LastPrice = mdGroup.get(new MDEntryPx()).ToString(); mdupdate.LastQty = Int32.Parse(mdGroup.get(new MDEntrySize()).ToString()); } The line I think is "weird" is this one: mdsfr.getGroup(i, mdGroup); // what does this line do?? The code compiles fine, but I have other issues in my app that don't let me run it. By the way, mdsfr is a MarketDataSnapshotFullRefresh message. Does anyone have any suggestions as to how I could improve this? thanks! -- View this message in context: http://www.nabble.com/weird-code-tp15836751p15836751.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |