Please help!... the comment of the sum of maximum reduction and reduction in current graph does not work correctly
-
Hello friends, I need to show in comments the total reduction of all the graphics and the current reduction of the operation that is in progress at that moment, for this purpose I used two codes that I found here in the forum, one is from the friend @JSTAP and the other one I don't remember who shared it, but when I put them in my ea they don't work correctly,

the code that shows the DD of the current graph

doesn't calculate anything at all,and the code that I copied from @JSTAP yes calculates but when closing the operations in the graph and re-execute new operations on it, it continues adding more and more values to the maximum DD that was already established without respecting whether those new added values are lower than the previous maximum DD...

the final result is an error...Can any expert help me solve this, to show the reduction of the current graph and the maximum reduction of all the graphs used in the terminal during the live session on the screen through comments?
The drawdown of the current chart must be reset after closing trades on that chart and the full drawdown must be reset after shutting down or restarting the terminal. -
Are you sure that custom code is correct? And you can remove the 'pass' block on top. It is redundant in that position.
-
@l-andorrà Hello friend, of course I copied the code, I hope I haven't confused something, but I think it is correct, at this moment I ask the pass block, but it still does not work correctly
-
I'm not a programmer, so I cannot confirm the code is correctly copied, but definitely the issue is there.
-
Hello friends, can someone help me please? I need a thread of code to display the maximum drawdown of the current chart and the maximum drawdown of the total sum of all open charts in mt5 terminal
-
You can dop that with variables (different for chart and all charts). However, the problem is the period to consider. If you need to check for all closed trades since the account was created, definitely a custom indicator will be far more efficient.
-
@l-andorrà Gracias por tu comentario amigo
-
@DragonZueloTrends No hay de qué.