/// <summary> /// Request Bid and offer prices subscription for a specific contract. /// </summary> /// <param name="SecEx">Exchange</param> /// <param name="symbol">Exchange symbol for contract</param> /// <param name="secID">unique identifier supplied by the exchnage for this contract /// For eurex this is the ticker and expiration</param> public void ttMarketDataRequest(string[] instrument, char reqType) { //string[] instrument must contain: //{SecurityExchange, Symbol,SecurityType,MaturityMonthYear} or //{SecurityExchange, Symbol,SecurityID} try { QuickFix42.MarketDataRequest mdr = new QuickFix42.MarketDataRequest(); mdr.set(new QuickFix.MDReqID(uniqueID())); mdr.set(new QuickFix.SubscriptionRequestType(reqType)); mdr.set(new QuickFix.MDUpdateType(QuickFix.MDUpdateType.FULL_REFRESH)); //required if above type is SNAPSHOT_PLUS_UPDATES //1=Top of Book, 0 = full book, other integer equals number of levels mdr.set(new QuickFix.MarketDepth(1)); mdr.set(new QuickFix.AggregatedBook(true)); QuickFix42.MarketDataRequest.NoMDEntryTypes tgroup = new QuickFix42.MarketDataRequest.NoMDEntryTypes(); tgroup.set(new QuickFix.MDEntryType(QuickFix.MDEntryType.BID)); mdr.addGroup(tgroup); tgroup.set(new QuickFix.MDEntryType(QuickFix.MDEntryType.OFFER)); mdr.addGroup(tgroup); tgroup.set(new QuickFix.MDEntryType(QuickFix.MDEntryType.TRADE)); mdr.addGroup(tgroup); QuickFix42.MarketDataRequest.NoRelatedSym sgroup = new QuickFix42.MarketDataRequest.NoRelatedSym(); // Define instrument sgroup.set(new QuickFix.SecurityExchange(instrument[0])); sgroup.set(new QuickFix.Symbol(instrument[1])); if (instrument.GetLength(0) == 4) { sgroup.set(new QuickFix.SecurityType(instrument[2])); sgroup.set(new QuickFix.MaturityMonthYear(instrument[3])); } else if (instrument.GetLength(0) == 3) { sgroup.set(new QuickFix.SecurityID(instrument[2])); } else { throw new System.Exception("Incorrect parameters for insturment definition"); } mdr.addGroup(sgroup); QuickFix.Session.sendToTarget(mdr, priceSessionID); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }