How to return the number of lots opened

 

Hello, I am trying to write an EA. I need to return the total number of lots opened, but I could only find the number of lots for the current selected order. Is there a selector in MQL4 like * in other programming languages? Thank you. 

 Jinstin 

 
bnnbJ: I need to return the total number of lots opened, but I could only find the number of lots for the current selected order. 

OrderSelect loop over all orders. Sum OrderLots.

Do you really mean total number of lots opened, or do you mean opened by your EA on you pair?

Reason: