/** * Constructor. * * @param report * execution report to adapt */ public ExecutionReportAdapter(ExecutionReport report) { mReport = report; /* * Use viewer id since the viewer is the originator, the one the * position is associated with. */ UserID viewer = mReport.getViewerID(); mKey = PositionKeyFactory.createKey(report.getInstrument(), mReport .getAccount(), viewer == null ? null : viewer.toString()); }
private boolean isValid(ExecutionReport report) { if (notNull(report.getInstrument()) && positive(report.getLastPrice()) && notZero(report.getLastQuantity())) { return true; } else { Messages.VALIDATION_MATCHER_INVALID_EXECUTION_REPORT.warn(PositionEngineFactory.class, report); return false; } }
String underlying = null; if(inReport instanceof ExecutionReport) { Instrument instrument = ((ExecutionReport) inReport).getInstrument(); underlying = mUnderlyingSymbolSupport.getUnderlying(instrument);
latestReportTable.addCell(report instanceof ExecutionReport ? ((ExecutionReport)report).getSide().name() : none); latestReportTable.addCell(report instanceof ExecutionReport ? String.valueOf(((ExecutionReport)report).getOrderQuantity()) : none); latestReportTable.addCell(report instanceof ExecutionReport ? ((ExecutionReport)report).getInstrument().getSymbol() : none); latestReportTable.addCell(report instanceof ExecutionReport ? String.valueOf(((ExecutionReport)report).getOrderType()) : none); latestReportTable.addCell(report instanceof ExecutionReport ? String.valueOf(((ExecutionReport)report).getPrice()) : none); latestReportTable.addCell(report instanceof ExecutionReport ? ((ExecutionReport)report).getSide().name() : none); latestReportTable.addCell(report instanceof ExecutionReport ? String.valueOf(((ExecutionReport)report).getOrderQuantity()) : none); latestReportTable.addCell(report instanceof ExecutionReport ? ((ExecutionReport)report).getInstrument().getSymbol() : none); latestReportTable.addCell(report instanceof ExecutionReport ? String.valueOf(((ExecutionReport)report).getOrderType()) : none); latestReportTable.addCell(report instanceof ExecutionReport ? String.valueOf(((ExecutionReport)report).getPrice()) : none);
@Override public OrderCancel createOrderCancel(ExecutionReport inLatestReport) { OrderCancelImpl order = new OrderCancelImpl(); assignOrderID(order); if (inLatestReport != null) { order.setAccount(inLatestReport.getAccount()); order.setBrokerID(inLatestReport.getBrokerID()); order.setBrokerOrderID(inLatestReport.getBrokerOrderID()); order.setQuantity(inLatestReport.getOrderQuantity()); order.setSide(inLatestReport.getSide()); order.setInstrument(inLatestReport.getInstrument()); order.setText(inLatestReport.getText()); addCustomFieldsFromReport(inLatestReport, order, SystemFIXMessageFactory.EXECUTION_REPORT_FIELDS); Map<String,String> customFields = order.getCustomFields(); if(customFields != null) { customFields.remove(String.valueOf(quickfix.field.MaxFloor.FIELD)); order.setCustomFields(customFields); } // set this manually after the customFields are copied, so that we take the OrigClOrdId from the report itself, // not from the custom field of the report order.setOriginalOrderID(inLatestReport.getOrderID()); } return order; }
@Override public OrderReplace createOrderReplace(ExecutionReport inLatestReport) { OrderReplaceImpl order = new OrderReplaceImpl(); assignOrderID(order); if (inLatestReport != null) { order.setAccount(inLatestReport.getAccount()); order.setBrokerID(inLatestReport.getBrokerID()); order.setBrokerOrderID(inLatestReport.getBrokerOrderID()); order.setOrderType(inLatestReport.getOrderType()); order.setPrice(inLatestReport.getPrice()); order.setQuantity(inLatestReport.getOrderQuantity()); order.setDisplayQuantity(inLatestReport.getOrderDisplayQuantity()); order.setSide(inLatestReport.getSide()); order.setInstrument(inLatestReport.getInstrument()); order.setTimeInForce(inLatestReport.getTimeInForce()); order.setOrderCapacity(inLatestReport.getOrderCapacity()); order.setPositionEffect(inLatestReport.getPositionEffect()); order.setText(inLatestReport.getText()); addCustomFieldsFromReport(inLatestReport, order, SystemFIXMessageFactory.CANCEL_REPLACE_EXCLUSION_FIELDS); // set this manually after the customFields are copied, so that we take the OrigClOrdId from the report itself, // not from the custom field of the report order.setOriginalOrderID(inLatestReport.getOrderID()); } return order; }