Closing 2 positions at the same time in hedged mode

 

Hi

I have two potions opened. 1 buy and 1 sell.I want to close them at the same time.

how do i do that using the inbuilt mt5 include codes?

Thanks.

 
Peter Kaiza:

Hi

I have two potions opened. 1 buy and 1 sell.I want to close them at the same time.

how do i do that using the inbuilt mt5 include codes?

Thanks.

Please help. 
 
Using trade.PositionCloseBy().
Reason: