search Nothing found
Main Algotrading documentation Trade operations Pending orders

PendingOrders.Count

Get the number of pending orders placed on the account

int PendingOrders.Count

Return value:

value of type int


Example:

// the function returns the number of placed Limit orders
private int GetLimitOrdersCount()
{
int poc = 0;
for (var i = PendingOrders.Count - 1; i >= 0; i--) {
PendingOrder order = PendingOrders.Find(PendingOrders[i].OrderId);
if (order != null) {
if ((order.OrderType == (int)OrderType.BuyLimit || order.OrderType == (int)OrderType.SellLimit)) {
poc++;
}
}
}
return(poc);
}



Subscribe to our newsletter and stay up to date with all the news!