How to close all trades when running equity is grater than starting equity by $1
-

I need a command that closes all trades when the running equity is grater than the starting equity by $1
-
above image is me try but without progress
-
can i please get help
-
That depends on you definition of 'starting equity'. Do you mean the one at the beginning of the day? At the current open price? When exactly?
-
current open price.
example if i open a trades at equity $90
equity gets to $91, close all open trades -
Check the profit, use check profit (unrealised) - close trades
-
Thanks but that's not really what I'm talking about.
in some cases like grid trading, the total profits can be negative while there was an increase in equity from the current equity/starting equity.
i just want a rule that when the current equity or starting equity increases buy a certain percentage or amount ($1) all open trades should be closed -
Equity is starting balance (equity) + running profit
-
i understand that.
i need a rule that when the current equity or starting equity increases buy a certain percentage or amount ($1) all open trades should be closed -
But this is what running profit is doing, do you mean a set group of trades profit?
-
Here's the full scope
I'm trying to create an MT5 bot this is the sequence.
Opens 2 buy and one sell position. Once sell position is in profit or hits TP it's closes and 2 more buys and one sell is added immediately. That loop continues and when the equity is greater than the starting equity (that's the starting equity before or at the beginning of that initial 2 buys and one sell) by $1 then everything closes.I've done everything on fxdreema an it works except the part where everything closes at $1 equity increase.
this is the link below to a test project for that part
https://fxdreema.com/shared/HFIEyVNqbi created a variable that stores the starting equity and now, i dont know how to use a condition block to point to the variable
-
What is saving the starting equity? Blocks under a no trade block will not work once a trade is running
-
i dont understand.
can you please show an example of how you think it should be based on the description of the bot i gave -
To save the EA starting equity add a pass block:

To close trades if equity is higher split the trees:

-
check this please
https://fxdreema.com/shared/6zclCRV8b -
i assumed that in the condition block, on the left operand i would select Account and equity (>) right operand variable. but there is not drop down or selection for picking variables
-
Connect the blocks, the condition is how you had it set

-

didnt work as expected
-
Put the result into a comment, this way you can see on screen when things should close
-
i have no idea on how to do that