Get Real Volume of a Symbol

 

Hey, I've been searching for a long time how to get the current volume of a Symbol (not an order) and I just can't find anything that works.

For example, I want to get the real volume of this symbol below (real volume would be 2500). How can I get that on MQL5?

SymbolPriceVolume
PETR415.541000
PETR415.601500

Thanks
 

 

Is this what you want ?

 
Alain Verleyen:

Is this what you want ?

I tried to use this but it didn't give me the right volume. In the example below, the volume should be: 46700 to sell and 38900 to buy (or 85600 in total), and as you can see, it says 28300...

 

 

PS* if there's a way to get only the buy volume and only the sell volume it would be even better, I tried SYMBOL_SESSION_BUY_ORDERS_VOLUME but it returns zero

Thanks 

 
lucas_heise:

I tried to use this but it didn't give me the right volume. In the example below, the volume should be: 46700 to sell and 38900 to buy (or 85600 in total), and as you can see, it says 28300...

 

 

PS* if there's a way to get only the buy volume and only the sell volume it would be even better, I tried SYMBOL_SESSION_BUY_ORDERS_VOLUME but it returns zero

Thanks 

Of course that's not the same.

To get the depth of market volume you need to use MarketBookGet() and make the addition yourself, I don't think there is a way to get it directly.

 
Alain Verleyen:

Of course that's not the same.

To get the depth of market volume you need to use MarketBookGet() and make the addition yourself, I don't think there is a way to get it directly.

Thank you very much, I got it working
 
Alain Verleyen:

Of course that's not the same.

To get the depth of market volume you need to use MarketBookGet() and make the addition yourself, I don't think there is a way to get it directly.

Can you take an example about   use MarketBookGet()  that it get Get Real Volume of a Symbol

seperated the bid and ask voume
Documentation on MQL5: Market Info / MarketBookGet
Documentation on MQL5: Market Info / MarketBookGet
  • www.mql5.com
[in] Reference to an array of Depth of Market records. The array can be pre-allocated for a sufficient number of records. If a dynamic array hasn't been pre-allocated in the operating memory, the client terminal will distribute the array itself.
Reason: