@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; }
ExecutionReport exec = (ExecutionReport) report; if(!exec.getOriginator().forOrders() || !exec.getHierarchy().forOrders()) { return false; if(exec.getLastQuantity() == null) { return false; if(exec.getLastQuantity().equals(BigDecimal.ZERO)) { return false; ExecutionType execType = exec.getExecutionType(); if(execType == null) {
/** * 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; } }
deltaReport); ExecutionReport execReport = (ExecutionReport)deltaReport; ExecutionType execType = execReport.getExecutionType(); "Skipping {} because its execution type {} is not a fill", //$NON-NLS-1$ execReport, execReport.getExecutionType()); continue; if(!execReport.getOriginator().forOrders() || !execReport.getHierarchy().forOrders()) { SLF4JLoggerProxy.debug(AveragePriceReportList.class, "Skipping {} because it's not appropriate for FIX Message Views", //$NON-NLS-1$ BigDecimal lastQuantity = execReport.getLastQuantity(); BigDecimal lastPrice = execReport.getLastPrice(); if(lastQuantity == null || !(lastQuantity.compareTo(BigDecimal.ZERO) > 0)) { SLF4JLoggerProxy.debug(AveragePriceReportList.class, Message averagePriceMessage = averagePriceReportHolder.getMessage(); ExecutionReport averagePriceReport = (ExecutionReport) averagePriceReportHolder.getReport(); BigDecimal existingCumQty = averagePriceReport.getCumulativeQuantity(); BigDecimal existingAvgPx = averagePriceReport.getAveragePrice(); BigDecimal newLastQty = lastQuantity; BigDecimal newTotal = existingCumQty.add(newLastQty); try { ReportHolder newReport = new ReportHolder(Factory.getInstance().createExecutionReport(averagePriceMessage, execReport.getBrokerID(), Originator.Broker,
@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; }
latestReportTable.addCell(DateUtils.dateToString(order.getLatestReport().getSendingTime())); latestReportTable.addCell(order.getOrderIdChain().toString()); 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(order.getLatestReport().getText()); handledOrders.add(report.getOrderID()); latestReportTable.addCell(report.getOrderStatus().name()); latestReportTable.addCell(DateUtils.dateToString(report.getSendingTime())); 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.getText());
} else if(report instanceof ExecutionReport) { ExecutionReport eReport = (ExecutionReport) report; if(CLOSED.contains(eReport.getOrderStatus())) { } else if(eReport.isCancelable()) { if(out != null) { if(eReport.getOriginator().forOrders() && eReport.getHierarchy().forOrders() && out.getReport().getOrderID().equals(orderId)) { return reportHolder; if(eReport.getOriginator().forOrders() && eReport.getHierarchy().forOrders()) { return reportHolder; } else { if(eReport.getOriginator() == Originator.Server) { out = reportHolder;
String underlying = null; if(inReport instanceof ExecutionReport) { Instrument instrument = ((ExecutionReport) inReport).getInstrument(); underlying = mUnderlyingSymbolSupport.getUnderlying(instrument); OrderStatus status = inReport.getOrderStatus(); if (Originator.Server == ((ExecutionReport) inReport) .getOriginator() && (status == OrderStatus.PendingNew || status == OrderStatus.PendingReplace)) { if (!mOriginalOrderACKs.containsKey(id)) {
replaceOrder.setDisplayQuantity(inNewOrder.getDisplayQuantity()); if(OrderType.Market.equals(executionReport.getOrderType())) { replaceOrder.setPrice(null); } else {
@Override public boolean matches(ReportBase item) { Originator originator = item.getOriginator(); Hierarchy hierarchy = item.getHierarchy(); if(item instanceof ExecutionReport) { ExecutionReport er = (ExecutionReport)item; ExecutionType executionType = er.getExecutionType(); return originator.forPositions() && hierarchy.forPositions() && executionType != null && executionType.isFill() && isValid(er); } else { return false; } }