Apama Capital Markets Foundation Documentation : Capital Markets Foundation : Order Management : Trade reporting services : Trade extractor service
Trade extractor service
The trade extractor service monitors the order flow within an application and generates trade events when trades occur on monitored orders. Similar to the position services, the trade extractor service uses a subscription-based model allowing applications to subscribe to a stream of trade events. Again, the stream of interest is identified by a set of "slicing" parameters (see the description of slicing in Defining slices that identify positions to be tracked), but unlike the position services only a single value can be specified for each slice dimension. Otherwise the interface to the trade extractor is very similar to any of the position services, as shown in this example:
com.apama.trade.OrderMonitoringTradeExtractorConstants const:=
new com.apama.trade.OrderMonitoringTradeExtractorConstants;
com.apama.trade.Subscribe sub := new com.apama.trade.Subscribe;
sub.serviceName := const.SERVICE_NAME();
sub.subscriptionId := integer.getUnique();
sub.symbol := "EUR/USD";
sub.service := "FIX";
sub.market := "CNX";
sub.trader := "A";
route sub;
com.apama.trade.SubscriptionResponse subr;

on com.apama.trade.SubscriptionResponse(
serviceName = const.SERVICE_NAME(), subscriptionId =
sub.subscriptionId):subr {
if subr.success then {
log "Success!";
else {
log "Failure!";
com.apama.trade.Trade trade;
on all com.apama.trade.Trade(serviceName = const.SERVICE_NAME(),
tradeStreamId = subr.tradeStreamId):trade {
log "Trade: "+trade.toString;
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback