Close partial with new comment

 
Hi,
I know there were some posts on the topic to close a position partially with preserving comments.

I know that it is possible. I can do a partial close from the MetaTrader UI setting a new comment.

How can I do it with code?

Currently, I assume that it can work with TradeRequest via OrderSend(). However, I did not figure out yet the parameters I should use here.
I refer to my position via the I'd but using order_type or omitting it results in filling errors or not valid order type.

Would be awesome if someone can guide me in the right direction 

Thank you!



 
Use the Standard LIbrary CTrade class.
Documentation on MQL5: Standard Library / Trade Classes / CTrade / PositionClosePartial
Documentation on MQL5: Standard Library / Trade Classes / CTrade / PositionClosePartial
  • www.mql5.com
PositionClosePartial(const string,const double,ulong) - CTrade - Trade Classes - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5