Close all trades (profitable and losable ones) when reached a profit amount.
-
Hello, I´m trying to create a EA that will close all running trades when reached a profit amount not matter if some of those running trades are losable ones. I´ve tried with the block "CHECK PROFIT UNREALIZED" and also with block "CHECK PROFIT AVERAGE and none of them works.
Any advice. I think this shouldn´t be difficult but i´ve been able to create it.
Thanks in advance. -
Try this:

-
Hi,
I am looking for similar solution. But isnt "For each trade" look at per trade? If i have 6 different pairs running and i want to close all 6 pairs as long as total pips hit 100. Do i still use "For each trade" on top of "Check profit"?
Thank you
-
@malospelos Without seeing how you have the blocks set up it is difficult to identify what the issue is. However, in the "Check profit" block make sure you have the filters set correctly. For example, if you want the EA to close trades opened manually and those opened by the ea make sure that is how the filter is set, or if it just manually opened trades set for those.
-
@traderea6 Yes, you just need to selecy this option in it:

That way all open trades from all active charts will be considered.
-
Thank you for the explanation and example.
-
You're welcome.
-
i love your work. how can i have an ea lock acertain profit , then it waits till a trade hits tp
-
i mean, if i opened a trade and my target is 100usd, how can i have the ea lock 10usd when pforits reach 50usd and then it waits to close when tp of 100 usd is hit.
-
Not sure I fully get it. DO you mean this?
- Trade is open with an initial 100 USD TP.
- Trade hits 50 USD profit. Immediately SL is moved to 10 USD profit.
- Trade is closed when 100 USD TP is hit but not when 10 USD profit SL is hit?
I don't get the last part, sorry.
-
YOUR RIGHT THATS WHAT I MEAN. I WANT THE NOT TO TRAIL THE POSITION , BUT TO ONLYLOCK 10 USD WHEN APROFIT OF 50 USD ISREACHED, THEN IT WAITS TO CLOSE THE TRADENOT UNTIL THE TAKEPFORIT OF 100 USD ISHIT
-
ANOTHER QUESTION WOULD ALSO BE, HOW TO CLOSE A SELL POSITION IF TWO PARABORIC SAR APPER BELOW THE CANDLE INCASE I HAD SOLD AND THE PARABORIC SAR ARE ABOVE THE CANDLE
-
But how can't a trade be closed when the SL is hit at 10 USD profit. This is the part I do not understand. When price hits a SL the trade is closed. There is no option to hold it. This is why I asked for the 3rd point.
-
i just wanted the bot to lock a few pips and then leave trade to hit take Tp
-
@Ssenyongacharl4 Yes, that I understand. What I don't understand is how can't the trade be closed if price hits the 10 USD SL. Is the trade supposed to be closed there?
-
hello , here is the bot i just made, its simple and working fine. im requesting someone to add for me or show me how to limit the bot from selling when stochastic goes below 3 on the 20 on both the 5,15, and 30 min timeframe. i also want to add how to a feature where the ea can close the profitable sell trade once stochastic drops below 3 on the 5,15,30 min .
-
https://fxdreema.com/shared/pgbvoQOWc
there is the project or in simple terms it we may use the 30 timeframe, stochastic cross below 30, no more selling or taking sell trades, and also exit the profitable sell position . then wait for buying opportunities when the conditions are meant .
-
@Ssenyongacharl4 In order to avoid opening new sells when Stoch is below 30, you need to add this block immediately above the 'sell now' block:

And in order to close all buys when Stochastinc is below 30 you need to create a separate block tree like this:

-
thanks i have just seen this now, sorry i had not seen it . so when creating a separate block , doi add on if trade or not block ?
-
The second structure needs to be in a completely separate structure. The first example is to be included in you current structure.