Samples.Roll.RollSellSide.OnSendCommand C# (CSharp) Method

OnSendCommand() public method

public OnSendCommand ( ExecutionCommand command ) : void
command FastQuant.ExecutionCommand
return void
        public override void OnSendCommand(ExecutionCommand command)
        {
            // Logic for send command.
            if (command.Type == ExecutionCommandType.Send)
            {
                Order order;

                // Create and send order to current futures contract.
                switch (command.Order.Type)
                {
                    case OrderType.Market:
                        if (command.Side == OrderSide.Buy)
                            order = BuyOrder(currentFuturesContract, command.Qty, command.Text);
                        else
                            order = SellOrder(currentFuturesContract, command.Qty, command.Text);

                        orderTable[order] = command;
                        Send(order);
                        break;

                    case OrderType.Limit:
                        if (command.Side == OrderSide.Buy)
                            order = BuyLimitOrder(currentFuturesContract, command.Qty, command.Price, command.Text);
                        else
                            order = SellLimitOrder(currentFuturesContract, command.Qty, command.Price, command.Text);

                        orderTable[order] = command;
                        Send(order);
                        break;

                    default:
                        break;
                }
            }
        }