public static ExecutionReport OrderToTrade(Order order)
        {
            var execTime   = order.TransactTime ?? DateTime.UtcNow;
            var execPrice  = (decimal)(order.AvgPx ?? 0);
            var execVolume = (decimal)(order.CumQty ?? 0);
            var tradeType  = ConvertTradeType(order.Side);
            var status     = ConvertExecutionStatus(order.OrdStatus);
            var instr      = GetInstrument();

            return(new ExecutionReport(instr, execTime, execPrice, execVolume, tradeType, order.OrderID, status)
            {
                ClientOrderId = order.ClOrdID,
                Message = order.Text,
                Success = true,
                OrderType = ConvertOrderType(order.OrdType),
                ExecType = ExecType.Trade,
                FailureType = OrderStatusUpdateFailureType.None
            });
        }
示例#2
0
        public static ExecutionReport OrderToTrade(Order order)
        {
            var execTime   = order.TransactTime ?? DateTime.UtcNow;
            var execPrice  = (decimal)(order.AvgPx ?? 0);
            var execVolume = (decimal)(order.CumQty ?? 0);
            var tradeType  = ConvertTradeType(order.Side);
            var status     = ConvertExecutionStatus(order.OrdStatus);
            //  var instr = ConvertSymbolFromBitMexToLykke(order.Symbol, configuration);
            var instr = new Instrument(BitMexExchange.Name, "USDBTC"); //HACK Hard code!

            return(new ExecutionReport(instr, execTime, execPrice, execVolume, tradeType, order.OrderID, status)
            {
                ClientOrderId = order.ClOrdID,
                Message = order.Text,
                Success = true,
                OrderType = ConvertOrderType(order.OrdType),
                ExecType = ExecType.Trade,
                FailureType = OrderStatusUpdateFailureType.None
            });
        }