Apama 10.3 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Order Management | Risk firewall | Sending orders into a risk firewall
 
Sending orders into a risk firewall
 
Sample code for using OrderSender
Setting order update callbacks
Modifying orders
Cancelling orders
Measuring order handling performance in the risk firewall
You use a com.apama.firewall.OrderSender object to send orders into a risk firewall. To obtain an order sender object, call the RiskFirewall.getOrderSender() action on the risk firewall you want to send orders to. This can be a local risk firewall or a remotely connected risk firewall. The getOrderSender() action returns an OrderSender object that you can use with only the risk firewall that supplied it. An order sender object provides actions for
*Sending new orders into the risk firewall
*Amending and cancelling orders that the risk firewall is processing
*Adding one or more callbacks, which the risk firewall executes whenever it receives an update to an order that it is handling
The risk firewall is handling a particular order from the time an order sender submits the order to the risk firewall until the timeout duration (set by the CONFIG_BUSTED_FILL_DURATION configuration parameter) has elapsed after the order has been completed or rejected. Thus, the period that the risk firewall is handling an order can include, for example, evaluation of the order, the order being sent to an adapter, the filling of the order, an order update being returned to the risk firewall's order receiver, the order update going into the risk firewall, and the order update arriving at the originating risk firewall order sender.
There are two actions for sending a new order into the risk firewall that provided the OrderSender object. You can call these actions on a local risk firewall or on a remotely connected risk firewall. The risk firewall must be unlocked.
*OrderSender.sendOrder() takes one argument, a com.apama.oms.NewOrder object, which is the new order you want the risk firewall to evaluate. This action does not return anything.
*OrderSender.sendOrderCb() takes two arguments:
*A com.apama.oms.NewOrder object, which is the new order you want the risk firewall to evaluate.
*A cbCompleted callback that the risk firewall executes whenever it receives an update for this order. The callback itself takes one argument, which is a com.apama.oms.OrderUpdate object. This action does not return anything.
Typically, you need only one order sender. However, you can obtain multiple OrderSender instances from a risk firewall. For example, you might have multiple trading strategies and use a different order sender for each one. All OrderSender objects receive all OrderUpdate events from the risk firewall.
If you spawn to a new context you cannot use the order sender in the new context.
See Sample code for using OrderSender.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.