Automatically stop EA/strategy when specific drawdown in pips is reached

Big problem with managing tens or hundreds of strategies forward tested over mt5 (or many of mt5 clients) is which strategy is working, which is on break even and which one are dead meaning they reached bigger drawdown than expected by backtest (or 1.5x of that value as that was mentioned over sqx courses). Monitoring all performance by 3rd party services like myfxbook or fx blue is crucial of course to see that by magic numers but there is still big problem of finding dead strategies in many charts by name/magic numer and removing them to save cpu resources and mt5 space (which allows only 99 charts opened per terminal).

What I would suggest is to add feature, maybe somewhere in trading options of builder as on/off setting to let strategy stop itself when specific dd were reach and that would work like build-in mql5 function in exported code. That will require looking to history of trades, filtering it by its magic number and calculate current drawdown - this will take some cpu resources so should be done in smart way. No need to act immidiately on every tick or even every new bar, can be done once per X hours or during night time/asian session once a day.

Important thing is to measure dd in pips, not in $ to avoid problems in future when mm is changed etc.

We could enable this in builder, set multiplier value of max dd pips from backtest to be considered as stop of strategy, nothing more. When strategy will stop working on mt5 side, chart with this EA can turn red or print really big monit about dd reached to make easier spotting and making cleaning terminal much easier. Also it could use metatrader alerts/popups.

Spotting dead strategies is biggest problem now, especially at big scale of forward testing. This solution could help at its source.


Attachments
No attachments
  • Votes +1
  • Project StrategyQuant X
  • Type Feature
  • Status New
  • Priority Normal

History

a
#1

astral

30.11.2023 12:14

Task created

AA
#2

Alex

02.12.2023 04:55
Voted for this task.

Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please