arimbur: I can't understand how to close an open buy with a ORDER_TYPE_CLOSE_BY. my code : this is what I get on the Journal on the strategy Tester..
I think you may be misunderstanding something. "ORDER_TYPE_CLOSE_BY" is only used when you have opposing positions on a "hedging" account, and you want to close them simultaneously against each other and save on trading costs (which does not seem to be your case).
Closes a position with the specified ticket by an opposite position
To close a normal single position by using the CTrade class, then use the following method:
Closes a position for the specified symbol

Documentation on MQL5: Standard Library / Trade Classes / CTrade / PositionClose
- www.mql5.com
PositionClose(const string,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
Hello,
I can't understand how to close an open buy with a ORDER_TYPE_CLOSE_BY.
my code :
Close Error code 0
this is what I get on the Journal on the strategy Tester..