"How to store all live orders for the instrument count into a variable Xa?"
You could add the orders to a list.
In the scope of the class:
private List<Order> myOrders;
In State.DataLoaded (or where ever you want the list to be reset)
myOrders = new List<Orders>();
In OnOrderUpdate():
myOrders.Add(order);
Then the list count would be the number of elements in the list.
Print(myOrders.Count);
for (int index = 0; index < myOrders.Count; index++)
{
}
If you wanted to add up the quantities of each order:
Print(myOrders.Sum(item => item.Quantity));
You could also choose to increment an integer each time an order is filled.
Comment