Download MetaTrader 5

Ask

To add comments, please log in or register
a1
13
a1  

Nice  to meet every one.

What function can be used in MT5 to close a openned position trade?

OrderClose?

Thanks Very much. 

Bogdan Caramalac
1112
Bogdan Caramalac  
There is no OrderClose() anymore. You have to market an order of the same size, opposite direction.
hasayama
612
hasayama  

Use predesigned library Trade.mqh for this purpose.

#include <Trade\Trade.mqh>

CTrade position;

 More info can be found here: https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade

Documentation on MQL5: Standard Library / Trade Classes / CTrade
  • www.mql5.com
Standard Library / Trade Classes / CTrade - Documentation on MQL5
To add comments, please log in or register