![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Could someone please advise how to close all orders by the total profit in pips?
Read the posts, some I didn't understand. I guess I haven't encountered them.
I understood this question as follows: how to close open orders for different instruments when the profit is reached.
Perhaps, it is not quite smart, but it is the way I implemented it:
What I don't understand is this.
Are you making money or making points?
Why bother searching for complex results when the desired (MAIN!) result is always in front of you: if the total profits (in money!) of all trades suit you, then close the whole damn thing!
What I don't understand is this.
Are you making money or making points?
Why bother to search for complex results, when the required (MAIN!) result is always in front of you: if the total profit (in money!) of all trades suits you, then close the whole damn thing!
If the profit is in money, then when you change the lot size, you must proportionally change the profit value. This is inconvenient.
Read the posts, some of them I didn't understand. I guess I haven't encountered them.
I understood this question as follows: how to close open orders for different instruments when the profit is reached.
Maybe, it is not very elegant, but this is how I implemented this question:
Why do we need such a big pause? Everything is working fast now.
I close without any pause at all.
Why the long pause? It's running fast now...
I don't pause at all.
It's a remnant of the previous code - I didn't understand the nature of the error and the meaning of theMarketInfo(OrderSymbol(),MODE_ASK), I left it there just in case. The Expert Advisor is incomplete.