
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
Thanks I did and it is almost working !!! thanks a lot !
I still have some problems when I try to close some part of the lots.
What I initially wrote was :
But then, a warning message saying "return value of 'orderClose' should be checked
So I wrote that, as suggested here:
Now there is this error message "'return' - 'void' function returns a value".
I am confused as I do not understand why should I wrote return 0.. or do anything else..
Any suggestions? :)
What is that you are actually trying to accomplish? Tell us your end goal in plain English.
Hi (again),
in plain English,
at this point, my EA is supposed to have taken a trade, and I want it to manage it:
When it reaches TP1 (profit), 80% of the position should be closed (lots3)
then this error message appears:
then this error message appears:
OrderClose isn't a void function but a bool function and you should check the return value if the OrderClose was successful or not. See documentation: https://docs.mql4.com/trading/orderclose
it took me some time to figure out how to make it work.
here is the final code (if it helps someone):