is there any function that returns opened positions from my broker account?

 

I need a function that request to the broker all the positions I have on my broker account.

For example, If I had a gold CFD, and 1000 shares of General Motors, and a Eur/us CFD....

Does it exist a function in mql4 that could get all these positions, with prices, number of position, from my account in my broker?

thanks

 
    for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if (
        OrderSelect(pos, SELECT_BY_POS)                 // Only my orders w/
    &&  OrderMagicNumber()  == magic.number             // my magic number
    &&  OrderSymbol()       == Symbol() ){              // and my pair.
        Print("open ",OrderTicket()," ",OrderLots()," lots"); // etc
    }
 

OrdersTotal()

returns all your orders on the current account. You can change accounts as well (afaik, haven't played with this yet) and check another as long as the "MT4 client" is the same.

 

thanks!!!!

Reason: