Can someone please tell me how to close all orders at total profit in pips?
Orders can only be deleted.
How do I calculate profit in pips?
Before you deleteOrders can only be deleted.
In MT4 they can be closed as there are not only pending orders but also market orders )) In MT5 orders are pending and market orders are position.
How do I calculate profit in pips?
Before deletingSelect each order and calculate the OrderProfit() + OrderSwap() + OrderCommision(). The obtained amount should be compared to the specified target in the deposit currency.
In MT4 you can close them as there are not only pending but also market orders )) In MT5 orders are pending and market orders are position.
So the market if I trade through MT4 is different from MT5?
Order(fr.ordre- order, order, fromlat.ordo- row, order) - an instruction, an order.
Position- thelocation of something

- ru.wikipedia.org
So the market if I trade through MT4 is different from the MT5 market?
Order(fr.ordre- order, order, fromlat.ordo- row, order) - an instruction, an order.
It is not the market that is different, only the terminology. Before the launch of MT5, there were only orders, market and pending orders in MT4. With the introduction of MT5, the terms were divided into an order/order, then a deal - order execution and as a result of a deal an existing position in the market...
Before the launch of MT5 in MT4 there were only orders, market orders and pending orders.
I trade on the market, not on MT, MT is just an application where the names of the functions are not correctly defined. Position - buy, sell, defender, striker.
Order - order to place, buy, sell, defender, striker, midfielder...
Deal...
I trade on the market, not on MT, MT is just an application which does not correctly define the name of the functions. Position - buy, set, defender, striker...
Order - order to place, buy, sell, defender, striker, midfielder...
Deal...
then trade and don't talk.
Please advise how to close all orders at the total profit in pips?
Need a global variable, let it be called CloseAll.
1. If CloseAll=false, then loop through all orders and sum up their profit in the auxiliary variable.
2. Compare the calculated profit with the set value, if it is more or equal, we set CloseAll=true.
If CloseAll=true - close all orders, if closing is successful, set CloseAll=false. If there were errors, then CloseAll=true, on the next tick we will close again.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use