Set stop loss on equity %
-
Hello, I would like to understand how to close all trades once a Drawdown% is reached. Using the formula you see in the attached photo it works but for the first time, as soon as the stop loss is touched, all next operations are closed immediately. How do you get the expert to update the equity?

-
@cri760 There is a few ways:
Bucket of trades>condition block bucket profit=>max drawdown, this will take the current drawdown.
As you have it with a flag to stop trading, check before buying/selling, reset when needed.
-
@jstap Thanks, if possible i want the more simple way. Client can set his % of equity SL with a constants like my first photo.
My idea is: the customer write a number from 1 to 100 for the stop loss in the input parameters, when the balance take SL, the expert (with terminate blocK) will stop and an alert will appear. How do you get the expert to restart and calculate the new equity and set a new stop loss based on the new equity?
Ex. balance 10k, he put 20 in stop loss input. At 8k it close all trades and stop the expert. But what is stopped? Autotrading button? Or is the expert removed from the chart directly? How to restart it and how to set a new drawdown stop loss with a new equity? -
Someone?
-
@cri760 I told you how you can do this.
-
@jstap And how i can set a number to close all trades in this way?

-
@cri760 You would have to replace the trade statistics with a constant/variable, have code/formulas working out the value needed or manually add. Use bucket of trades in place of trade statistics as your 1st picture..
-
@jstap Forgive me but I really can't figure out what exactly I have to do. I've been using fxdreema for 10 days , isn't there an easier way to do what I asked? Or maybe show me? Thanks
-
@cri760 I have put an example in the link:
-
@jstap Perfect now works, instead of putting a positive number from 1 to 100 as a percentage I have to insert a complete negative number (ex. -1000). For information, how is the logic of the set flags I see?
-
@cri760 When target is met the flag is set to false, once a day it's set back to true, this is checked before placing an order.
-
@jstap That's to restart the expert right? For the equity stop loss with bucket condition is constantly updated? (with profit sum)
-
@cri760 Yes the flag will stop trade until it's reset.