Calculate equity drawdown percentage and open opposite direction trade
-
@l-andorrà @jstap I have created a custom block that opens an equal trade for the opposite direction when the drawdown reaches 5% but I am still having an issue.
Suppose of there are 5 buy trades opened for ( 0.01, 0.02, 0.03,0.04,0.05= 0.15 ) it will open 1 sell trade for 0.15 .But if the other EA continues to opens another trade it also start to open hedging for those trades.
Please if you can suggest any way to stop taking further hedge trades until 0.15 is already opened and once the hedge trade is closed it may open again.
Thank you

-
You will have to disable auto or use the magic no to interact, the only easy way is to have all in 1. You also have global variables, but to get EA, to access you will need to be able to add logic.
-
@jstap Is there any block that can stop the loop if one trade is already opened?
Thank you
-
Not externally, possibly with magic, but unlikely
-
@jstap I have added Counter pass once and now it is working fine and not opening more than one trades.
But how can I reset this counter if the trade is closed. Please advise


Thank you
-
Use the reset block and put it under the reason to reset
-
Can you please give some hint to put condition to check hedge trade and if closed then move to reset function .
Thank you
-
If count trades == 1 reset
-
@jstap Please advise as it is working but again starts to open several orders

-
5 & 6 in a separate tree
-
Sorry but not opening the trade again

-
But it does without 6 & 7?
-
For the clarification
I have a EA that opens multiple lots , for 2,4 & 5 it opens trade equivalent to sum of opened trades when drawdown reaches condition value.
i.e. 0.01 , 0.02 , 0.03 = 0.06But if I open another trade i.e. 0.02 then the EA again opens hedging for 0.02 and continues for all new opened trades.
I wanted to restrict it to open one trade at a time. I put "counter: pass once" and it doesn't open new trades.
I want to add a function that re-execute the condition and opens the trade if I close the hedge trade of 0.06 manually or by trailing stop loss.( Even if the trades from the other EA are active). Run the loop only if trade of 0.06 is closed.
Thank you
-
"But if I open another trade i.e. 0.02 then the EA again opens hedging for 0.02 and continues for all new opened trades" then something is possibly activating the reset before it needs to. once per bar, pass once, and reset work as they say they do.
-
Yes, That I can understand , only if you can suggest something to fix it
-
In this situation, you need to test, change, test. if this block set-up has not been used before (and it's now to me), you will need to find the causes, so you can find the cure
-
can't stop laughing at the end result
