The best way to close
-
Leave the conditions for opening deals aside, every time a deal is opened, I want to check a certain condition:
Closing deals is at the last closed buy trade, it must close a sell trade,
Sometimes there are ten winning buy trades and one winning sell trade, when the buy side is going to close, I want to close only one and not ten.
https://fxdreema.com/shared/pjo5mlj5b -
@khalids222 Hello,
I'm not sure I totally understand what you need but if all you need is to close 1 of the trades regardless of which one, try one of the following blocks:
- close least profitable trade
- close most profitable trade
-
@q8carpenter said in The best way to close:
I'm not sure I totally understand what you need but if all you need is to close 1 of the trades regardless of which one, try one of the following blocks:
close least profitable trade
close most profitable trade
Thank you for your response.
I want to close one trade at a time so that it is buy, sell, buy and sell in the same order
I don't want to close just one -
So in your case, if 10 buys and 1 sell are in profit, the EA once per bar should close trades in this order?
buy
sell
buy
buy
buy
buy
buy
buy
buy
buy
buywhich will take 10 bars to close them all?
-
@q8carpenter I want close old buy then sell if profit, if sell not profit not close any buy
-
@khalids222 so you mean that when the sell is in profit, you close the buy and a sell?
-
@q8carpenter yes
-
@q8carpenter In order for the picture to be clear, each time a buy will be closed, then a sell will be closed, then a buy will be closed and then a sell will be closed in the same order
During these closings, one direction will have more than one winning trade and the other will not have any winning trade, in this case, I want to wait until the other party wins one trade and it is closed.
Let me make the explanation easier: When I choose to close by profitable trades and i put profit more 5 pips . All trades that have won more than five points will be closed
i want close only one trades -
Sorry but I still may not have understood what is required correctly. Have a look at the screenshot. Wouldn't something like this work?

-
@q8carpenter Well let me explain:
I am here looking for the last close, if it was a sell, for example, close the buy when it gains five points.
The problem here, when there are five buy trades all are winning and all are more than five pips, it will close them all, I want to close only one of them
example:
1- buy profit 5 pips - i want close this or any trade from buy
2- buy profit 10 pips not close
3- buy profit 15 pips not close
4- buy profit 20 pips not close
5- sell profit 5 pips i want close this
6- buy profit 25 pips ( i want close any trade from buy )
7 buy profit 30 pips not close
9- sell profit 5 pips i want close thisAs you can see, there are several profitable buying deals and there is no profitable selling deal, I want every time a buy deal is closed (only one deal) to close the sell deal if it is profitable, if there is no profitable sell, do not close the buy until the sale is closed
-
@khalids222
If you see the last example i sent, the blocks i used will close only 1 trade. -
@q8carpenter Unfortunately, these blocks are not.
I want a block that closes only one deal in each opening process, so that closing the same direction is not repeated.
My main problem is closing only one of several similar deals
It can be more than a deal less than five pips will close it all.
I mean, if we have five buy deals, all of which are greater than five points, it will close them all at once when choosing (trades more than five points). I want to close only one of these five only -
@khalids222
Actually the blocks I sent will close 1 trade. but the way you have it set up, it will mean that it will close one trade alternating between buys and sells but close a trade once per bar. because it will close the most profitable trade only which is 1, and since you start your chain with a (once per bar) block then only 1 trade can be closed per pass -
@q8carpenter ok thank you so much .
-
@khalids222 you're welcome. I hope things work out for you
