Total Positions vs Total Orders

 
Is there a way to get the total positons held besides looping with OrderSelect looking for OP_BUY and OP_SELL and counting with OrderLots() and if not, does anyone know how fast this, especially in a rapidly moving market such as around a report?
 

loop with OrderSelect is only one way to count positions

 
ScottB wrote:
Is there a way to get the total positons held besides looping with OrderSelect looking for OP_BUY and OP_SELL and counting with OrderLots() and if not, does anyone know how fast this, especially in a rapidly moving market such as around a report?

Thanks, I was afraid of that.  I now keep the range of prices where I have open orders and only check if the price is in that range.
Reason: