Example #1
0
        public bool Delete(Order delorder)
        {
            bool      orderDeleted;
            Container container = ProcessContainers(bookRoot, delorder.Instrument, delorder, null);

            //container = ProcessContainers(container.ChildContainers, order.OrderType, order, container);
            if (container.ChildContainers.Exists(delorder.BuySell.ToString()) == false)
            {
                LeafContainer buyContainer  = new LeafContainer(this, "B", container);
                LeafContainer sellContainer = new LeafContainer(this, "S", container);
                container.ChildContainers["B"] = buyContainer;
                container.ChildContainers["S"] = sellContainer;
            }
            LeafContainer leafContainer = container.ChildContainers[delorder.BuySell.ToString()] as LeafContainer;

            if (leafContainer != null)
            {
                orderDeleted = leafContainer.DeleteOrder(delorder);
            }
            else
            {
                orderDeleted = false;
            }

            return(orderDeleted);
        }
Example #2
0
        public bool Delete(Order delorder)
        {
            bool orderDeleted;

            LeafContainer leafContainer = bookRoot[delorder.Instrument].ChildContainers[delorder.BuySell.ToString()] as LeafContainer;

            if (leafContainer != null)
            {
                orderDeleted = leafContainer.DeleteOrder(delorder);
            }
            else
            {
                orderDeleted = false;
            }

            return(orderDeleted);
        }