To close orders it is better to use OrderClosePrice () function instead of Bid or Ask or any other price.
Sample: "OrderClose ( OrderTicket (), OrderLots (), OrderClosePrice (), 0 ) ;"
- docs.mql4.com
Hi All,
I have an issue with the function below. It is part of an EA.
When a certain profit is attained for a grid and for a specific cross, the fuction is called and is supposed to close all the current orders and delete all the pending ones for the specific cross.
It seems to be working till a certain extent as often a few orders will stay open.
Any suggestions on why and how to solve the issue_
Thanks,
MG
Invert the loop (start from highest index, not the lowest)
Thanks both for the suggestions, I will try them both
MG
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
I have an issue with the function below. It is part of an EA.
When a certain profit is attained for a grid and for a specific cross, the fuction is called and is supposed to close all the current orders and delete all the pending ones for the specific cross.
It seems to be working till a certain extent as often a few orders will stay open.
Any suggestions on why and how to solve the issue_
Thanks,
MG