private void SessionOnOrderFilled(OEC.API.Order order, OEC.API.Fill fill)
        {
            if (!fill.Active)
            {
                return;
            }

            SendOutMessage(new ExecutionMessage
            {
                SecurityId = new SecurityId
                {
                    SecurityCode = order.Contract.Symbol,
                    BoardCode    = order.Route == null ? order.Contract.Exchange.Name : order.Route.Name,
                },
                ExecutionType         = ExecutionTypes.Transaction,
                OriginalTransactionId = _orderTransactions.TryGetValue2(order) ?? 0,
                OrderId       = order.ID,
                TradeId       = fill.ID,
                TradePrice    = order.Contract.Cast(fill.Price),
                ServerTime    = fill.Timestamp.ApplyTimeZone(TimeHelper.Est),
                TradeVolume   = fill.Quantity,
                SystemComment = fill.Comments,
                Commission    = fill.Commission.ToDecimal(),
                HasTradeInfo  = true,
            });
        }
Ejemplo n.º 2
0
        private void SessionOnOrderFilled(OEC.API.Order order, OEC.API.Fill fill)
        {
            if (!fill.Active)
            {
                return;
            }

            SendOutMessage(new ExecutionMessage
            {
                ExecutionType         = ExecutionTypes.Trade,
                OriginalTransactionId = _orderTransactions.TryGetValue2(order) ?? 0,
                OrderId       = order.ID,
                TradeId       = fill.ID,
                TradePrice    = order.Contract.Cast(fill.Price),
                ServerTime    = fill.Timestamp.ApplyTimeZone(TimeHelper.Est),
                Volume        = fill.Quantity,
                SystemComment = fill.Comments,
                Commission    = fill.Commission.ToDecimal(),
            });
        }