Basic questions from a newcomer - page 8

 
JRandomTrader #:

What's stopping you from selling four shares?

Apparently I have to change the account type to Netting... just found out
 
Vladislav Krivorutsko #:
apparently, for this I need to change the account type to Netting... just found out

If it's about hedging, you have to specify a position ticket.

Here, right from the reference: "When modifying or closing a position in a hedging system, be sure to specify its ticket (MqlTradeRequest::position)".

 
Vladislav Krivorutsko open position? That is, for example, there was an open Long position for 10 shares - how can I reduce the position by 4 shares? Or it cannot be done in mt5?

Looking at the method

PositionClosePartial

Closes part of the position by a specified symbol or with a specified tick


Added: but this is ONLY for hedge trading accounts!

Документация по MQL5: Стандартная библиотека / Торговые классы / CTrade / PositionClosePartial
Документация по MQL5: Стандартная библиотека / Торговые классы / CTrade / PositionClosePartial
  • www.mql5.com
PositionClosePartial(const string,const double,ulong) - CTrade - Торговые классы - Стандартная библиотека - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5