how to get highest drawdown during a position holding time?

 

I am intrigued why among the many properties available to query for any position after closing, its highest Drawdown is no readily available? I noted such a data is plotted in one of the MQL5 reports for an EA, but in the list of entries such data in not available. In TradingView this information is provided as max percent decline and max money down for the entire account.  Is there a fucntion to collect this data for an entry in MQL5?

I was planing to code this, and attach it as a comment when closing a position. But I wonder if may be this is already available?

 
@Camilo Mora : I am intrigued why among the many properties available to query for any position after closing, its highest Drawdown is no readily available? I noted such a data is plotted in one of the MQL5 reports for an EA, but in the list of entries such data in not available. In TradingView this information is provided as max percent decline and max money down for the entire account.  Is there a fucntion to collect this data for an entry in MQL5? I was planing to code this, and attach it as a comment when closing a position. But I wonder if may be this is already available?

It is not called "drawdown". The correct terminology is Maximum Adverse Excursion (MAE). There is also the concept of Maximum Favourable Excursion (MFE).

There is no function that returns those values nor are they automatically tracked. Both values have to be computed by your code.

Forum on trading, automated trading systems and testing trading strategies

EA Drawdown extraction mql4

Fernando Carreiro, 2023.03.04 12:28

You can't "extract" the drawdown data. You have to track and calculate it yourself in your code (which may be somewhat complex for a beginner coder).

The correct terminology is Maximum Adverse Excursion (MAE), which you can also seen in MT5 backtest reports.


Reason: