search Nothing found
Main Algotrading documentation Trade operations Pending orders

PendingOrders.Find

We get a pending order by its unique identifier.

PendingOrder Positions.Find(Id)

Input parameters

Parameter
Type
Description
Id
int
Unique identifier of a pending order


Return value:

It returns an object of type PendingOrder -  if the order exists and NULL, if there is no such order


Example:

// The function searches for all Limit orders and returns the number of found 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);
}