Capital Markets Adapters 10.7 | Apama Capital Markets Adapters Documentation 10.7 | Apama Base FIX Adapter | FIX service monitors | Client session | FIX_DataManager | Symbol Normalization | Requesting the security definition for multi-leg securities
 
Requesting the security definition for multi-leg securities
Following are the request/response events for getting the security definition:
package com.apama.fix

event InstrumentDataRequest {
string marketId;
string key;
string symbol;
dictionary <string,string> extraParams;
sequence<string> requiredParams;
}

event InstrumentDataResponse {
string marketId;
string key;
boolean success;
string errorMessage;
dictionary <string,string> parameters;
}
Requesting required information
In the extraParams field of the InstrumentDataRequest, you can give the filtering information so that the matching security definitions are received as InstrumentDataResponse() for each matched security.
Example: To fetch the security definition for the multi-leg instrument whose leg information is as follows
309 : 217922 (tag 309 is UnderlyingSecurityID)
309 : 217951

com.apama.fix.InstrumentDataRequest
("MARKET_DATA","40","",{"167":"MLEG","207":"ICE_IPE","146":"
[{309:\"217922\"},{309:\"217951\"}]"},["55","48","207"])
This request will result in unique/multiple InstrumentDataResponse() events. If there are more than one security available with this legs information, then user gets multiple responses. In case of multiple responses the boolean flag "success" of response event is set to false.
Receiving multi-leg information as part of InstrumentDataResponse
The 'parameters' field of the InstrumentDataResponse() is populated based on the tag list mentioned in requiredParams field of the InstrumentDataRequest. The requiredParams sequence field now accepts repeating group as a string.
Example: To receive the repeating field tags 310 311 313, the request has to be
com.apama.fix.InstrumentDataRequest
("MARKET_DATA","40","",{"167":"MLEG","207":"ICE_IPE"},
["55","48","207","[146 310 311 313]"])
The response would be
com.apama.fix.InstrumentDataResponse
("MARKET_DATA","40",true,"",{"146":"[{\"310\":\"FUT\",\"311\":
\"IPE e-Brent\",\"313\":\"201103\"},
{\"310\":\"FUT\",\"311\":\"IPE e-Brent\",\"313\":\"201108\"}]",
"207":"ICE_IPE","48":"219924","55":"
IPE e-Brent","MAPPED_SYMBOL":"MLEG:ICE_IPE:_:ICE_IPE:217922:
FUT:201103-ICE_IPE:217951:FUT:201108"})
Note:
Always mention the tags in requiredParams field of the InstrumentDataRequest(). The tags mentioned in this parameter are the out going tags in each request. The mapped symbol cache is formed against these tags as Mapped symbol.
Using mapped symbol
Subscription management
com.apama.marketdata.SubscribeDepth("FIX_SERVICE",
"MARKET_DATA", "CME:CFL1-CFG1",{})
com.apama.marketdata.UnsubscribeDepth("FIX_SERVICE",
"MARKET_DATA", "CME:CFL1-CFG1",{})
com.apama.marketdata.Depth("CME:CFL1-CFG1",[],[],[],[],[],{})

or

com.apama.marketdata.SubscribeTick("FIX_SERVICE", "MARKET_DATA",
"CME:CFL1-CFG1",{})
com.apama.marketdata.UnsubscribeTick("FIX_SERVICE", "MARKET_DATA",
"CME:CFL1-CFG1",{})
com.apama.marketdata.Tick("CME:CFL1-CFG1", 123.23, 100000,{})
Order management
com.apama.oms.NewOrder("19","CME:CFL1-CFG1",35350,"BUY",
"LIMIT",1,"FIX_SERVICE","","","TT_TRADING","","",{})

com.apama.oms.AmendOrder("19","FIX_SERVICE","CME:CFL1-CFG1",
120450,"BUY","LIMIT",2000,{})

com.apama.oms.CancelOrder("19", "FIX_SERVICE", {})

com.apama.oms.OrderUpdate("19", "CME:CFL1-CFG1",35350,"BUY",
"LIMIT",1000,true,true,true,false,false,false,"",1000,
1000,1000,35350,35350,"Fill:Partial Fill",{})