Ejemplo n.º 1
0
        void OrderDeleted(object sender, OrderDeletedEventArgs e)
        {
            string  Tag         = e.OldOrder.OrderTag;
            int     RowIndex    = TagList.IndexOf(Tag);
            DataRow RelevantRow = SummaryTable.Rows[RowIndex];

            RelevantRow["WorkingOrderKey"] = "";
        }
Ejemplo n.º 2
0
        public void LimitOrder()
        {
            var sec = new Security()
            {
                Id = 1, Type = SecurityType.Future, Group = "GC", Product = "GC", Contract = "GCZ6"
            };
            var book = new OrderBook(sec);

            book.SetStatus(SecurityTradingStatus.Open);

            OrderCreatedEventArgs createdArgs = null;

            book.OrderCreated += (sender, e) => { createdArgs = e; };

            book.CreateLimitOrder(1, TimeInForce.Day, null, Side.Buy, 100, 3);

            Debug.Assert(createdArgs != null);
            Debug.Assert(createdArgs.Order.Status == OrderStatus.Created);
            Debug.Assert(createdArgs.Order.Id == 1);
            Debug.Assert(createdArgs.Order.Price == 100);
            Debug.Assert(createdArgs.Order.Quantity == 3);
            Debug.Assert(createdArgs.Order.FilledQuantity == 0);
            Debug.Assert(createdArgs.Order.RemainingQuantity == 3);
            Debug.Assert(createdArgs.Order.Side == Side.Buy);
            Debug.Assert(createdArgs.Order.Type == OrderType.Limit);
            Debug.Assert(createdArgs.Order.TimeInForce == TimeInForce.Day);
            Debug.Assert(createdArgs.Order.Security == sec);

            OrderUpdateEventArgs updatedArgs = null;

            book.OrderUpdated += (sender, e) => { updatedArgs = e; };

            book.UpdateLimitOrder(1, 105, 5);

            Debug.Assert(updatedArgs != null);
            Debug.Assert(updatedArgs.Order.Status == OrderStatus.Updated);
            Debug.Assert(updatedArgs.Order.Id == 1);
            Debug.Assert(updatedArgs.Order.Price == 105);
            Debug.Assert(updatedArgs.Order.Quantity == 5);
            Debug.Assert(updatedArgs.Order.FilledQuantity == 0);
            Debug.Assert(updatedArgs.Order.RemainingQuantity == 5);

            OrderDeletedEventArgs deletedArgs = null;

            book.OrderDeleted += (sender, e) => { deletedArgs = e; };

            book.DeleteOrder(1);

            Debug.Assert(deletedArgs != null);
            Debug.Assert(deletedArgs.Order.Status == OrderStatus.Deleted);
            Debug.Assert(deletedArgs.Order.Id == 1);
            Debug.Assert(deletedArgs.Order.Price == 105);
            Debug.Assert(updatedArgs.Order.Quantity == 5);
            Debug.Assert(deletedArgs.Order.FilledQuantity == 0);
            Debug.Assert(deletedArgs.Order.RemainingQuantity == 0);
            Debug.Assert(deletedArgs.Reason == null);
        }
        private void OnOrderDeleted(object sender, OrderDeletedEventArgs e)
        {
            var row = GetContractRow(e.DeletedUpdate.Instrument);

            if (row != null)
            {
                row.ProcessMessage(e);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// OrderDeleted InstrumentTradeSubscription callback.
 /// </summary>
 /// <param name="sender">Sender (InstrumentTradeSubscription)</param>
 /// <param name="e">OrderDeletedEventArgs</param>
 void m_instrumentTradeSubscription_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     if (e.DeletedUpdate.SiteOrderKey == m_LastOrderSiteOrderKey)
     {
         txtSiteOrderKey.Text     = String.Empty;
         m_lastOrder              = null;
         gboModifyOrder.Enabled   = false;
         buttonDeleteLast.Enabled = false;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Event notification for order deleted
 /// </summary>
 void m_ts_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     if (e.DeletedUpdate.SiteOrderKey == m_orderKey)
     {
         // Our parent order has been deleted
         Console.WriteLine("Our parent order has been deleted: {0}", e.Message);
     }
     else if (e.DeletedUpdate.SyntheticOrderKey == m_orderKey)
     {
         // A child order of our parent order has been deleted
         Console.WriteLine("A child order of our parent order has been deleted: {0}", e.Message);
     }
 }
Ejemplo n.º 6
0
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>   Event notification for order deletion. </summary>
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 void m_instrumentTradeSubscription_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     Console.WriteLine("\nOrderDeleted [{0}]", e.OldOrder.SiteOrderKey);
 }
Ejemplo n.º 7
0
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>   Event notification for order deletion. </summary>
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 void m_algoTradeSubscription_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     Console.WriteLine("\nOrderDeleted [{0}] , Message : {1}", e.OldOrder.SiteOrderKey, e.Message);
 }
Ejemplo n.º 8
0
 void ts_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     //Console.WriteLine("OrderDeleted");
 }
 public void ProcessMessage(OrderDeletedEventArgs e)
 {
     NumCancellations++;
 }
 /// <summary>
 /// Event notification for order deleted
 /// </summary>
 void m_ts_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     if (e.DeletedUpdate.SiteOrderKey == m_orderKey)
     {
         // Our parent order has been deleted
         Console.WriteLine("Our parent order has been deleted: {0}", e.Message);
     }
     else if (e.DeletedUpdate.SyntheticOrderKey == m_orderKey)
     {
         // A child order of our parent order has been deleted
         Console.WriteLine("A child order of our parent order has been deleted: {0}", e.Message);
     }
 }
 /// <summary>
 /// Event notification for order deleted
 /// </summary>
 void m_ts_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     Console.WriteLine("Order was deleted.");
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Triggered when an Order monitored by this subsciption is deleted
 /// </summary>
 void tradeSubscription_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     UpdateAuditLog("OrderDeleted", e.DeletedUpdate);
 }
 /// <summary>
 /// OrderDeleted InstrumentTradeSubscription callback.
 /// </summary>
 /// <param name="sender">Sender (InstrumentTradeSubscription)</param>
 /// <param name="e">OrderDeletedEventArgs</param>
 void m_instrumentTradeSubscription_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     if (e.DeletedUpdate.SiteOrderKey == m_LastOrderSiteOrderKey)
     {
         txtSiteOrderKey.Text = String.Empty;
         m_lastOrder = null;
         gboModifyOrder.Enabled = false;
         buttonDeleteLast.Enabled = false;
     }
 }
Ejemplo n.º 14
0
 void OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
 }
Ejemplo n.º 15
0
 private void HandleOrderDeleteAccepted(object sender, OrderDeletedEventArgs args)
 {
     ordersToClients[args.Order.Id].Send(new CancelAck(args.Order, orderInfos[args.Order.Id], args.Reason));
     SendBookUpdates(args.Order.Security);
 }
 /// <summary>
 /// Triggered when an Order monitored by this subsciption is deleted 
 /// </summary>
 void instrumentTradeSubscription_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     UpdateAuditLog(e.DeletedUpdate);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Event notification for order deleted
 /// </summary>
 void m_trd_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     Console.WriteLine("Order was deleted.");
 }
 public void ts_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     if (e.DeletedUpdate.SiteOrderKey == orderKey)
     {
         // Our parent order has been deleted
         Console.WriteLine("Our parent order has been deleted: " + e.Message);
         Dispose();
     }
     else if (e.DeletedUpdate.SyntheticOrderKey == orderKey)
     {
         // A child order of our parent order has been deleted
         Console.WriteLine("A child order of our parent order has been deleted: " + e.Message);
     }
 }
 /// <summary>
 /// Triggered when an Order monitored by this subsciption is deleted 
 /// </summary>
 void tradeSubscription_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     UpdateAuditLog("OrderDeleted", e.DeletedUpdate);
 }
Ejemplo n.º 20
0
 void ts_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     processOrder(TTOrderStatus.Deleted, e.OldOrder);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Triggered when an Order monitored by this subsciption is deleted
 /// </summary>
 void instrumentTradeSubscription_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     UpdateAuditLog(e.DeletedUpdate);
 }
 public void ts_OrderDeleted(object sender, OrderDeletedEventArgs e)
 {
     if (e.DeletedUpdate.SiteOrderKey == orderKey)
     {
         // Our order has been deleted
         Console.WriteLine("Our order has been deleted: " + e.Message);
         Dispose();
     }
 }