Download MetaTrader 5

Ask

To add comments, please log in or register
Write articles and earn money. We pay 200 USD for them!
a1
13
a1 2010.09.19 11:39 

Nice  to meet every one.

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

OrderClose?

Thanks Very much. 

Bogdan Caramalac
1103
Bogdan Caramalac 2010.09.19 16:51  
There is no OrderClose() anymore. You have to market an order of the same size, opposite direction.
hasayama
609
hasayama 2010.09.19 22:33  

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