Capital Markets Adapters 10.15 | Apama Capital Markets Adapters Documentation 10.15 | Trading Technologies Adapter | Trading Technologies Gateway platform | MultiLeg orders
 
MultiLeg orders
Note:
To Get MultiLeg Orders to work properly, "Send summary fills" option must be enabled for your account by Trading Technologies.
Orders can be placed using SecurityID(tag 48) of MLEG instrument. For example:

com.apama.oms.NewOrder("18","ES",35350,"SELL","LIMIT",1,
"TT-FIX","","","TT_TRADING","","",
{"207":"CME","48":"0GFES100B0BK00ES40F09AZD67E97E01DA85064","22":"5","1":"progress2"})
com.apama.oms.NewOrder("19","ES",35350,"BUY","LIMIT",1,"TT-FIX",
"","","TT_TRADING","","",
{"207":"CME","48":"0GFES100B0BK00ES40F09AZD67E97E01DA85064","22":"5","1":"progress2"})
Order Updates of the whole MLEG instrument are obtained as:

com.apama.oms.OrderUpdate("19","ES",35350,"BUY","LIMIT",1,false,false,
false,false,false,false,false,"0G22GS006",1,0,1,35350,35350,"Filled:SummaryFill",
{"10455":"UD:1V:ST0113911579","10527":"272979","10762":"Straddle",
"146":"2","15":"USD","167":"MLEG","18203":"CME","198":"00005UMV",
"204":"0","207":"CME","35":"8","375":"CME000A","442":"3","47":"A",
"48":"0GFES100B0BK00ES40F09AZD67E97E01DA85064","52":"20100118-10:32:44.342",
"59":"0","60":"20100118-10:32:44.439","6038":"20100118-10:32:44.311",
"77":"O","Account":"progress2","ExecID":"1m1swmm17jfgbq","ExecType":"2",
"Market":"TT_TRADING","OrdStatus":"2","SERVICE_NAME":"TT-FIX",
"__APAMA_ORDER_STATE":"settled"})
com.apama.oms.OrderUpdate("18","ES",35350,"SELL","LIMIT",1,false,false,
false,false,false,false,false,"0G22GS005",1,0,1,35350,35350,
"Filled:SummaryFill",{"10455":"UD:1V:ST0113911579","10527":"272980",
"10762":"Straddle","146":"2","15":"USD","167":"MLEG","18203":"CME",
"198":"00005UMU","204":"0","207":"CME","35":"8","375":"CME000A",
"442":"3","47":"A","48":"0GFES100B0BK00ES40F09AZD67E97E01DA85064",
"52":"20100118-10:32:44.358","59":"0","60":"20100118-10:32:44.439",
"6038":"20100118-10:32:30.420","77":"O","Account":"progress2",
"ExecID":"zcq0qr1ywz3po","ExecType":"2","Market":"TT_TRADING",
"OrdStatus":"2","SERVICE_NAME":"TT-FIX","__APAMA_ORDER_STATE":"settled"})
Individual leg fills are routed to the application as com.apama.fix.DisplayEvent:

com.apama.fix.DisplayEvent("TT Spread 'Leg' Execution Report",
[com.apama.fix.DisplayField("TRANSPORT","TT_TRADING"),
com.apama.fix.DisplayField("SESSION","FIX.4.2:PROGRESS2->TTDEV14O"),
com.apama.fix.DisplayField("OrderID","0G22GS006"),
com.apama.fix.DisplayField("ClOrdID","1:1:1263810764.6"),
com.apama.fix.DisplayField("OrigClOrdID",""),
com.apama.fix.DisplayField("ExecID","64vvpawvej30"),
com.apama.fix.DisplayField("ExecTransType","New"),
com.apama.fix.DisplayField("ExecType","Fill"),
com.apama.fix.DisplayField("OrdStatus","Fill"),
com.apama.fix.DisplayField("Account","progress2"),
com.apama.fix.DisplayField("Symbol","ES"),
com.apama.fix.DisplayField("Side","BUY"),
com.apama.fix.DisplayField("OrderQty","1"),
com.apama.fix.DisplayField("OrdType","LIMIT"),
com.apama.fix.DisplayField("Price","35350"),
com.apama.fix.DisplayField("LastShares","1"),
com.apama.fix.DisplayField("LastPx","35325"),
com.apama.fix.DisplayField("LeavesQty","0"),
com.apama.fix.DisplayField("CumQty","1"),
com.apama.fix.DisplayField("AvgPx","35325"),
com.apama.fix.DisplayField("10455","ESG0 C0680"),
com.apama.fix.DisplayField("10527","272981"),
com.apama.fix.DisplayField("NoRelatedSym","0"),
com.apama.fix.DisplayField("Currency","USD"),
com.apama.fix.DisplayField("SecurityType","OPT"),
com.apama.fix.DisplayField("18203","CME"),
com.apama.fix.DisplayField("SecondaryOrderID","00005UMV"),
com.apama.fix.DisplayField("MaturityMonthYear","201002"),
com.apama.fix.DisplayField("PutOrCall","1"),
com.apama.fix.DisplayField("StrikePrice","68000"),
com.apama.fix.DisplayField("CustomerOrFirm","0"),
com.apama.fix.DisplayField("SecurityExchange","CME"),
com.apama.fix.DisplayField("MsgType","8"),
com.apama.fix.DisplayField("MultiLegReportingType","2"),
com.apama.fix.DisplayField("Rule80A","A"),
com.apama.fix.DisplayField("SecurityID","00B0BK10ES40F09AZ"),
com.apama.fix.DisplayField("SendingTime","20100118-10:32:44.358"),
com.apama.fix.DisplayField("Text","Leg Fill"),
com.apama.fix.DisplayField("TimeInForce","0"),
com.apama.fix.DisplayField("TransactTime","20100118-10:32:44.439"),
com.apama.fix.DisplayField("6038","20100118-10:32:44.311"),
com.apama.fix.DisplayField("OpenClose","O")],[])
com.apama.fix.DisplayEvent("TT Spread 'Leg' Execution Report",
[com.apama.fix.DisplayField("TRANSPORT","TT_TRADING"),
com.apama.fix.DisplayField("SESSION","FIX.4.2:PROGRESS2->TTDEV14O"),
com.apama.fix.DisplayField("OrderID","0G22GS005"),
com.apama.fix.DisplayField("ClOrdID","1:0:1263810750.6"),
com.apama.fix.DisplayField("OrigClOrdID",""),
com.apama.fix.DisplayField("ExecID","quhbhg1e5tzl6"),
com.apama.fix.DisplayField("ExecTransType","New"),
com.apama.fix.DisplayField("ExecType","Fill"),
com.apama.fix.DisplayField("OrdStatus","Fill"),
com.apama.fix.DisplayField("Account","progress2"),
com.apama.fix.DisplayField("Symbol","ES"),
com.apama.fix.DisplayField("Side","SELL"),
com.apama.fix.DisplayField("OrderQty","1"),
com.apama.fix.DisplayField("OrdType","LIMIT"),
com.apama.fix.DisplayField("Price","35350"),
com.apama.fix.DisplayField("LastShares","1"),
com.apama.fix.DisplayField("LastPx","35325"),
com.apama.fix.DisplayField("LeavesQty","0"),
com.apama.fi