Download MetaTrader 5

Position close in MQL5

To add comments, please log in or register
TheWho
9
TheWho  

Hello,

How should I implement immediate position close in MLQ5?

The only way to close something that I found is SendOrder with request action TRADE_ACTION_REMOVE. But removed pending orders, and not active position. 

 Thanks 

Dua Yong Rew
5448
Dua Yong Rew  
If its a buy position, do a sell with same volume and vice versa
Atsushi Yamanaka
5453
Atsushi Yamanaka  
#include <Trade\Trade.mqh>
CTrade            m_trade;

m_trade.PositionClose(Symbol());
 
little1hu
8
little1hu  

Hi.

I good like close only  which are open whith specific magicnumber.

To add comments, please log in or register