simple function to locate the drawdown % MAX
-
hi everyone, I searched online and on the forum how to create 2 lines of code to create a DD% filter, in the end, almost discouraged, I decided to create an EA with all the essentials inside to be able to create this filter, I leave you the link to the project
https://fxdreema.com/shared/RPtcSNQ0e
explanation:
the code is really nonsense, just create a conditional block in which the initial balance sheet and equity are examined by executing this formula:
constant DD = 95
if equity <= balance [(*DD %) it must be entered in the appropriate "adjust" space]example: €93 <= €100 (*95%)
= €93 <= 95
= TRUE
= close tradewhat happens is that every 5% of DD the EA will close the orders, this function can be used anywhere, even to create a daily DD, in which other blocks are used to stop the EA
Let me know if I was helpful to you and what you think

-
Thank you very much for sharing.
-
Hola que tal amigos, me gustaria saber si usando esta funsion que compartiste en tu enlace puedes crear un detector de DD% maximo que nos indique en el grafico en pantalla, de cuanto ha sido el maximo DD y el DD actual, en cada activo donde estes ejecutando el EA?
-
@DragonZueloTrends No. Habría que usar otro código distinto. Ese no serviría para lo que pides.