@Override
public void onEvent(ExecutionReport report, long sequence, boolean endOfBatch) throws Exception {
String orderId = report.getOrderID().getValue();
String side = report.getSide().getValue() == Side.BUY ? "bought" : "sold";
ExecType execType = report.getExecType();
String symbol = report.getSymbol().getValue();
if (execType.getValue() == ExecType.NEW) {
logger.debug("Order {} accepted", orderId);
} else {
double tradeQty = report.getLastShares().getValue();
double tradePrice = report.getLastPx().getValue();
logger.debug("Broker {} {} {} shares of {} at {}", new Object[]{broker, side, tradeQty, symbol, tradePrice});
}
}
});