close all when total profits reach
-
Hi everybody;
I want it to get 1usd profit for each order.
1st order could not make 1 USD profit 2. When the order will be opened, total 2 USD profit will be closed at the same time. The order has not been able to make a total profit of 2 USD. 3rd order will be opened and all orders will be closed when a total of 3 USD has been profited.
how can I do that ? thank you for your help!

-
go and see my answer to someone else i gave last night
its in the interrupt negotiations question of 2 days ago -
1 order = 1 usd
2 order = 2 usd
3 order = 3 usd
4 order = 4 usd
5 order = 5 usd
as.
Close
determine the price based on the order -
Not sure I understand you. Do all orders have the same open price but different TP levels?
-
Hello;
I want each order to get a certain gain.
for example 1 USD.
if the opened order reaches 1 usd, it will close.
I have 5 open orders open, if total profit reaches 5 * 1 = 5 usd, all will be closed. -
@dragonfly617 I think you may try to use the block named "Check profit (average)" which has profit mode option to check pips & money.
Just a kind warning:
I used pips as profit mode, but this block just simply divide gained pips to number of orders. It does not take lot size into calculation. Which may lead you get unexpected results.
I hope this helps.
Regards.
-
Thank you for the help.
but I'm looking for something like this
order = n
n * 1 usd = close all orders. -
@dragonfly617 Mql4 function OrdersTotal() will return the number of trades, so you can make a block like this:

Note that the function will also count the pending orders. -
@roar Just for my interest, why do you multiply the function result times 1?
-
@trader-philipps just to illustrate where the "* 1 usd" will come into play, and that there you can also change the dollar amount to "OrdersTotal() * 2", for example.
-
Thank you very much for your help.
-
Hello; roar
gave this error

-
@dragonfly617 The method doesn't work with that tick box, for some reason. You have to untick it.

-
@roar said in close all when total profits reach:
@dragonfly617 Mql4 function OrdersTotal() will return the number of trades, so you can make a block like this:

Note that the function will also count the pending orders.how did you put custome code at section?at profit amount?
-
@bliinkboy Take your keyboard and write it there. You can put custom code to anywhere. Anywhere. Just try it out