Help with bucket of trades/multiple order profit(fixed) a new question
-
Hi everyone, as indicated in the topic title I've made an EA that open multiple trades. Now I want to close all the trades at a defined profit.
I tried first with bucket of trades->condition bucket of trades-profit-total value set on a specific condition of profit but it doesn't work.
The istruction (loop for trades/orders) check profit for each trades doesn't work too cause it close one order at time.
So, if I had multiple orders how can I make the ea close all at a desidered profit?
thank's to all -
have you tried block Check profit (unrealized)?
-
@miro1360 thank's for the answer. I haven't seen this block, my fault. if I understand correctly how it work I can set a determinate value to profit and it close all the opened trade, isn't it? now I try, thank's again
-
If I want that te EA stops for n minutes how I can do it?
-
this block is working like Check, next action you need connect after block (closing trades, and other what you will do) ... in block are filters, you can set only for buy trades or only for sell trades, group, market, and also trades with some minimal amount of profit (for MT4), next you select if you will compare pips or money ...
EA stops for n minutes, try to working with blocks in Time Filters, I recommend you first try how are this blocks working (one after another, you can observe behavior when you connect something after this block, like Trace, or creating objects on candles) ...
-
People were asking for stopping the EA for some time multiple times before and it's time for me to do something about it. It will be some block with name like "Skip ticks" or similar, and the idea will be that when this block runs, it will tell the EA to skip the following ticks for some time.
The same thing can be done right now as well, but with some datetime variable that needs to be set and then checked.
-
@miro1360 is there a similar block to use as a stop loss? Can I use this block with a negative value? If so can I use one for profit and another one for stop loss?
-
block Check profit (unrealized) with negative value? sure, you can ...
what you mean by "stop loss"? you mean actuall trades profit (as negative) or you mean stop loss level?
negative profit can be checked (as negative value)
...
stop loss level can be checked with combination from pink blocks (For each trade + something) ... -
@miro1360 Thanks for your reply. I didn't word it very well. I meant if i have a number of trades and the total loss of those trades reaches a certain amount then i want to close all trades. Similar to having the combined profit of a group of trades reach a certain profit level and closing all trades.
So not using it as a stop loss level but using it as a stop loss $ amount.
It looks like I can use the check profits (unrealized) then. I will go and test it out.
-
-
ask https://chatgpt.com/ it is good help me to fix my proplem