Calculate equity drawdown percentage and open opposite direction trade
-
Dear all ,
For all the experts and members I would request to help me in my project.
As I have very little knowledge for coding. I have already created auto trading turn on and and turn off function.
I just want help regarding a drawdown percentage calculator when reached a custom input value should open a hedging trade against the total lots floating in loss.
Thank you -
If you would like help make a start, add the shared link, then say what's not working. To put it simply, there are blue blocks that check unrealised profit, -x.xx with a buy block under, although you will likely need a no trade block for the hedge group to limit unnecessary trades.
-
@jstap Thank you for your reply.
https://fxdreema.com/shared/sOm1xtRcd
Please check , I want to open a hedging trade against the total floating lots at 5 percent of equity drawdown. Again reopen the hedging trade after next 5 percent and trigger autotrading off.
Thank you
-
You have conflicting issues in 1 tree, equity will never = your drawdown result if no trades are running. to disable auto trading is good, but get this working before worrying about this
-
Yes , actually one EA is running already to open trade. I just need to make a hedging EA to support the risk management.
Will it work accordingly if the trades are opened?
Thank you -
Not with a no trade block, unless magic numbers are different, in the same tree you cannot have 2 conflicting drawdown blocks, if true pass, but 2 will never be true at the same time.
-
@jstap Is it possible to create different trees as the shared project
-
By trees I mean a set of blocks all linked, you can have as many trees as you want. Trees will do separate/linked work but without being connected to another
-
Can you please help as this drawdown hedging function is not working. Thank you
-
Set it up with just 1 drawdown, for testing under a if testing block create a trade.
-
I am sorry but I am a beginner , please if you can elaborate a little and please guide me .
https://fxdreema.com/shared/PxajdmYJ
Thank you
-
I don't mind helping/guiding, but you'll have to tell me what the EA is doing/supposed to do
-
I just want to assemble an EA that just calculates the drawdown and opens new hedging trade on 5 percent of drawdown.
Not for trading and only for the risk management.
Thank you -
Try this, it will work with any trade, but uses the account value:

-
@jstap Thank you for your help. I appreciate your efforts.
The EA is now opening trades as it reaches drawdown value of 5 percent. But it is opening several trades for both buy and sell trades and even not match the lots size.
If you can please advise modification of setting to open only one trade for opposite side or hedging for sum of lots already opened i.e. 5 buy trades (0.01 , 0.01 , 0.02 , 0.04 , 0.08 = 0.16 ). It should only open one trade for sell 0.16
https://fxdreema.com/shared/igNfSNEvb
Thank you
-
This places extra trades (I think) because every time it places a trade there is a new one to work with. To have it working as you want you need to add to the logic, the lots used are inside the buy/sell blocks, what it should/should not be doing, and needs adding so it does what you need. Fix 1 thing, then the next until all is working
-

I have change few settings and tried to find where can I enter the if condition and what would be the condition.
https://fxdreema.com/shared/igNfSNEvb
Thank you
-
Check type is set for buys, so to place the opposite it needs set up like the picture, also if you have both set up on orange, it will place a buy and sell at that time.

-
-
@l'andorrà Can you also please provide any solution. Thank you
