How to get all pending orders with prices and volumes in Broker?

 

How to get all pending orders with prices and volumes in Broker?


e.g. XAUUSD buy:

1850: buy volume: 100lots, sell volume: 20lots

1845: buy volume: 500lots, sell volume: 10lots

 
  1. Perhaps you should read the manual. OrderSelect
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  2. Magic number only allows an EA to identify its trades from all others. Using OrdersTotal/OrdersHistoryTotal (MT4) or PositionsTotal (MT5), directly and/or no Magic number/symbol filtering on your OrderSelect / Position select loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
              Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 programming forum (2013)
              PositionClose is not working - MQL5 programming forum (2020.02.21)
              MagicNumber: "Magic" Identifier of the Order - MQL4 Articles (2006)
              Orders, Positions and Deals in MetaTrader 5 - MQL5 Articles 2011

    You need one Magic Number for each symbol/timeframe/strategy. Trade current timeframe, one strategy, and filter by symbol requires one MN.

 
Do you have sample code for me to do that?
 
Chui Yu Lui #:
Do you have sample code for me to do that?

search codebase, there are many indicators that do that already.

 
Revo Trades #:

search codebase, there are many indicators that do that already.

Got it, thanks Revo!