FastQuant.Order.OnExecutionCommand C# (CSharp) Méthode

OnExecutionCommand() public méthode

public OnExecutionCommand ( ExecutionCommand command ) : void
command ExecutionCommand
Résultat void
        public void OnExecutionCommand(ExecutionCommand command)
        {
            Commands.Add(command);
            Messages.Add(command);
        }

Usage Example

Exemple #1
0
        public void Replace(Order order, double price, double stopPx, double qty)
        {
            if (order.IsNotSent)
            {
                throw new ArgumentException($"Can not replace order that is not sent {order}");
            }

            var command = new ExecutionCommand(ExecutionCommandType.Replace, order)
            {
                DateTime        = this.framework.Clock.DateTime,
                Id              = order.Id,
                OrderId         = order.Id,
                ClOrderId       = order.ClOrderId,
                ProviderOrderId = order.ProviderOrderId,
                ProviderId      = order.ProviderId,
                RouteId         = order.RouteId,
                PortfolioId     = order.PortfolioId,
                TransactTime    = order.TransactTime,
                Instrument      = order.Instrument,
                InstrumentId    = order.InstrumentId,
                Provider        = order.Provider,
                Portfolio       = order.Portfolio,
                Side            = order.Side,
                OrdType         = order.Type,
                TimeInForce     = order.TimeInForce,
                Price           = order.Price,
                StopPx          = order.StopPx,
                Qty             = order.Qty,
                OCA             = order.OCA,
                Text            = order.Text,
                Account         = order.Account,
                ClientID        = order.ClientID,
                ClientId        = order.ClientId
            };

            Messages.Add(command);
            order.OnExecutionCommand(command);
            this.framework.EventServer.OnExecutionCommand(command);
            if (IsPersistent)
            {
                Server?.Save(command, -1);
            }
            order.Provider.Send(command);
        }
All Usage Examples Of FastQuant.Order::OnExecutionCommand