/// <summary> /// This event is fired when a previously requested commodity symbol /// is resolved into the instruments list. /// this is where we will send a security definition back to our clients /// </summary> /// <param name="commodityName"> /// The commodity symbol that was requested by the user in the /// corresponding RequestCommodityInstruments method call. /// </param> /// <param name="instrumentTypes"> /// Instrument type bitmask that was set by the user in the /// corresponding RequestCommodityInstruments method call. /// </param> /// <param name="instrumentNames"> /// Collection, which contains names of instruments corresponding to the requested /// commodity and filtered by the bitmask set in RequestCommodityInstruments Method. /// </param> private void CEL_CommodityInstrumentsResolved(string commodityName, eInstrumentType instrumentTypes, CQGCommodityInstruments instrumentNames) { /* * Dont use this as we handle the list try { // set up a security def message QuickFix.SecurityReqID mySecReqID; QuickFix.SecurityResponseID mySecurityResponseID; QuickFix.SecurityResponseType mySecurityResponseType; QuickFix43.SecurityDefinition mySecDef; QuickFix.Message myMsg; // get teh CFI code string myCFICode = getCFI(instrumentTypes); for (int l = 0; l <= instrumentNames.Count - 1; l++) { // set up a security def message mySecReqID = new QuickFix.SecurityReqID(m_ID); mySecurityResponseID = new QuickFix.SecurityResponseID(KaiUtil.Identities.Instance.genReqID()); mySecurityResponseType = new QuickFix.SecurityResponseType(QuickFix.SecurityResponseType.LIST_OF_SECURITIES_RETURNED_PER_REQUEST); mySecDef = new QuickFix43.SecurityDefinition(mySecReqID, mySecurityResponseID, mySecurityResponseType); myMsg = mySecDef as QuickFix.Message; KaiUtil.QFUtils.Instance().SetupInstrument(ref myMsg, "FIX.4.3", commodityName, "", instrumentNames[l], "CQG", "XXX", myCFICode, "", 0.0); // send our response message back to the clients of the adapter this.sendResponse("d", mySecDef.ToString()); m_CQGHostForm.Message = "Product resolved:" + instrumentNames[l]; } } catch (Exception myE) { log.Error("CEL_TradableCommoditiesResolved", myE); } * */ }
void CQGApp_CommodityInstrumentsResolved(string commodity_name, eInstrumentType instrument_types, CQGCommodityInstruments cqg_commodity_intruments) { try { // Iterate through the resolved instrument names collection foreach (string instrumentName in cqg_commodity_intruments) { // Subscribe to each instrument in the collection m_CQGHostForm.CQGApp.NewInstrument(instrumentName); } } catch (Exception myE) { log.Error("CQGApp_CommodityInstrumentsResolved", myE); } }