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!
- Comment on partially closed order
- Questions about MQL4
- Partial close not working
Use the Standard LIbrary CTrade class.
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
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register