Exemple #1
0
        public void OnCancelBrokerOrder(SymbolInfo symbol, object origBrokerOrder)
        {
            if (debug)
            {
                log.Debug("OnCancelBrokerOrder( " + origBrokerOrder + ")");
            }
            var order = CancelBrokerOrder(origBrokerOrder);

            if (confirmOrders != null)
            {
                confirmOrders.OnCancelBrokerOrder(symbol, origBrokerOrder);
            }
        }
Exemple #2
0
        private bool TryCancelBrokerOrder(PhysicalOrder physical)
        {
            bool result = false;

            if (physical.OrderState != OrderState.Pending &&
                // Market orders can't be canceled.
                physical.Type != OrderType.BuyMarket &&
                physical.Type != OrderType.SellMarket)
            {
                if (debug)
                {
                    log.Debug("Cancel Broker Order: " + physical);
                }
                sentPhysicalOrders++;
                TryAddPhysicalOrder(physical);
                physicalOrderHandler.OnCancelBrokerOrder(symbol, physical.BrokerOrder);
                result = true;
            }
            return(result);
        }