public bool OnCreateBrokerOrder(CreateOrChangeOrder other)
        {
            var order = other.Clone();

            if (debug)
            {
                log.Debug("OnCreateBrokerOrder( " + order + ")");
            }
            if (order.Size <= 0)
            {
                throw new ApplicationException("Sorry, Size of order must be greater than zero: " + order);
            }
            if (CreateBrokerOrder(order))
            {
                if (confirmOrders != null)
                {
                    confirmOrders.ConfirmCreate(order.BrokerOrder, true);
                }
                UpdateCounts();
            }
            return(true);
        }
        public bool OnChangeBrokerOrder(CreateOrChangeOrder other)
        {
            var order = other.Clone();

            if (debug)
            {
                log.Debug("OnChangeBrokerOrder( " + order + ")");
            }
            var origOrder = CancelBrokerOrder(order.OriginalOrder.BrokerOrder);

            if (origOrder == null)
            {
                if (debug)
                {
                    log.Debug("PhysicalOrder too late to change. Already filled or canceled, ignoring.");
                }
                var message = "No such order";
                if (onRejectOrder != null)
                {
                    SendReject(order, true, message);
                }
                else
                {
                    throw new ApplicationException(message + " while handling order: " + order);
                }
                return(true);
            }
            if (CreateBrokerOrder(order))
            {
                if (confirmOrders != null)
                {
                    confirmOrders.ConfirmChange(order.BrokerOrder, true);
                }
                UpdateCounts();
            }
            return(true);
        }