How to use PositionClose() to close more than one orders?

 

Because the SYMBOL_VOLUME_MAX is 5.0, I have to open two orders: a 5.0 lots sell order and a 4.7 lots at the same time. 

When I use trade.PositionClose(_Symbol,3) to close the opened orders, I get the error:

failed instant buy 9.70 EURUSD at 1.16000 [Invalid volume]

How can I close both of these two opened orders? 

Thanks! 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM - Documentation on MQL5
 
 
Rosh:
Try to use function PositionOpen, read article Limitations and Verifications in Expert Advisors

Thank you very much.

I've read the article which you recommended me. However, I still resolve my problem.

I can use PositionOpen to open two orders(5.0 lots & 4.7 lots ) because the total lots is more than  SYMBOL_VOLUME_MAX, but I cannot use PositionClose to close both of them. When I use PositionClose, it said invalid volume(which is 9.7 lots since SYMBOL_VOLUME_MAX=5.0). Is there any way to close an order which is more than  SYMBOL_VOLUME_MAX?

Thank you again. 

Reason: