public static ExecutionReport CreateRejectNewOrderExecutionReport( NewOrderSingle n, string execID, string rejectionReason, int? rejectionCode = null) { var exReport = new ExecutionReport( new OrderID("unknown orderID"), new ExecID(execID), new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.REJECTED), new OrdStatus(OrdStatus.REJECTED), n.Symbol, n.Side, new LeavesQty(0m), new CumQty(0m), new AvgPx(0m)); if (rejectionCode.HasValue) { exReport.OrdRejReason = new OrdRejReason(rejectionCode.Value); } exReport.Set(n.ClOrdID); exReport.Set(n.OrderQty); if (n.IsSetAccount()) exReport.SetField(n.Account); return exReport; }
public static ExecutionReport CreateRejectNewOrderExecutionReport( NewOrderSingle n, string execID, string rejectionReason, int?rejectionCode = null) { var exReport = new ExecutionReport( new OrderID("unknown orderID"), new ExecID(execID), new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.REJECTED), new OrdStatus(OrdStatus.REJECTED), n.Symbol, n.Side, new LeavesQty(0m), new CumQty(0m), new AvgPx(0m)); if (rejectionCode.HasValue) { exReport.OrdRejReason = new OrdRejReason(rejectionCode.Value); } exReport.Set(n.ClOrdID); exReport.Set(n.OrderQty); if (n.IsSetAccount()) { exReport.SetField(n.Account); } return(exReport); }
internal static ExecutionReport CopyFromOrder(this ExecutionReport executionReport, NewOrderSingle newOrderSingle) { executionReport.Set(newOrderSingle.Symbol); executionReport.Set(newOrderSingle.Side); executionReport.Set(newOrderSingle.OrdType); executionReport.Set(newOrderSingle.ClOrdID); executionReport.Set(newOrderSingle.OrderQty); if (newOrderSingle.IsSetAccount()) { executionReport.SetField(newOrderSingle.Account); } return(executionReport); }