Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }