Beispiel #1
0
 private void removeOrderItemFromGrid(OrderGridData item) 
 {    
     orderGrid.Remove(item);
     orderGridView.Refresh();
 }
Beispiel #2
0
 //##################################################################3
 //Create a separate methods because the UI thread doesnt like when you access data on its stack
 //Called by a delegate instead by calling the Invoke method above
 private void updateOrderItemToGrid(OrderGridData item) 
 {
     if (orderGrid.Contains(item))
         orderGrid.Remove(item);
     
     orderGrid.Insert(0, item);
     orderGridView.Refresh();
 }
Beispiel #3
0
 public void addUpdateOrder(OrderGridData ord)
 {
     orderGridView.Invoke(new UpdateOrderItemDelegate(this.updateOrderItemToGrid), ord);
 }
Beispiel #4
0
 public void removeOrder(OrderGridData ord)
 {
     orderGridView.Invoke(new RemoveOrderItemDelegate(this.removeOrderItemFromGrid), ord);
 }
        private OrderGridData createOrderGridItem(Order ord)
        {
            OrderGridData data = new OrderGridData();
            data.side = ord.side.ToString();
            data.symbol = ord.product.symbol;
            data.orderNum = ord.internalId;
            data.qty = ord.orderQuantity;
            data.filled = ord.fillQuantities.Sum();

            if (ord is MarketOrder)
                data.type = "MKT";
            else if (ord is LimitOrder)
                data.type = "LMT";
            else
                data.type = "NA";

            return data;
        }