Capital Markets Adapters 10.7 | Apama Capital Markets Adapters Documentation 10.7 | Apama Base FIX Adapter | FIX service monitors | Server session | Order server | FIX_OrderServer
 
FIX_OrderServer
The FIX_OrderServer translates incoming fix messages (new, amend, cancel) into their apama equivalents and reports on order status using FIX execution reports. An order server is configured and instantiate by sending in the following event:
com.apama.fix.ServerConfiguration {
  string connection;
  dictionary<string,string> configuration;
}
This event ties the order server to a particular server transport (connection) and sets up its runtime behavior (configuration). It is possible to configure multiple servers if there is more than one server transport configured in the IAF.
On receiving a com.apama.fix.NewOrderSingle event from its transport, the server creates a com.apama.fix.ExecutionReport with a OrdStatus of PENDING_NEW. It then generates an order id and creates a corresponding com.apama.oms.NewOrder event before sending it to the target service. The target service defaults to the scenario order service but can be configured to be something else (for example, a market simulator).
If the original FIX order specifies a target strategy (default FIX tag 847), its identity will be copied into the broker field of the resultant Apama order. This is commonly used to specify a Scenario Order Handler (see ScenarioOrderService). Strategy parameters (default FIX tag 848) will be merged into the extra parameters of the order.
For example, NewOrderSingle should contain the details of the TargetStrategy (Tag 847) and TargetStrategyParameters (Tag 848). TargetStrategyParameters can be provided using the following convention "848"="Param1:Value1;Param2:Value2; …. ;ParamN:ValueN", as shown in the following event sample:
com.apama.fix.NewOrderSingle("Server","","1:0:1e+09","","1","ORCL","1",
"20010909-02:46:40",10000,"1",0,[],{},
{"109":"Client_1_ID","847":"TestBrokerID","848":"strgy1:100;strgy2:200;strgy3:300"})
The above NewOrderSingle will be translated to the following:
com.apama.oms.NewOrder("Server:1e+09:1","ORCL",0,"BUY","MARKET",10000,
"MarketSimulator","TestBrokerID","","Server","","Client_1_ID",
{"109":"Client_1_ID","Account":"",
"__timestamps":"{}","strgy1":"100","strgy2":"200","strgy3":"300"})
For each com.apama.oms.OrderUpdate event that is received with generated order id, the order state is determined using an implementation of the state change matrix as defined by the FIX specification (see http://www.fixprotocol.org/specfications ).
Any change in state is reported back to the client as a com.apama.fix.ExecutionReport.
Order amendments and cancels are possible and are translated into their Apama equivalents (that is, com.apama.oms.AmendOrder or com.apama.oms.CancelOrder) and it is possible to request order status by sending in a com.apama.fix.OrderStatusRequest message for the order in question.
FIX Order Server