SELECTIVE ABSOLUTE DRAWDOWN MANAGER EA or Selective ADM EA v1 for Metatrader 4. mq4 and ex4 files.
The idea of this EA it´s to manage the absolute drawdown of a complete trading account where different trading EA are running in differents symbols or magic numbers.
So how should it work?
Example:
I have a trading account with 4 symbol. Each symbol have 4 different trading bots. So i open a fifth chart to install this new management EA. This new management EA will track the absolute drawdown of the entire trading account and when the absolute drawdown it´s more than 8% he will close all orders and pending orders ONLY from a symbol or from a magic number with the highest absolute drawdown value.
First time "cycle":
EA1 symbol EURUSD.cz Magic Number= 2021 ADD= 1.01%
EA2 symbol EURAUD.cz Magic Number= 2022 ADD = 4.77%
EA3 symbol USDCHF.cz Magic Number= 2023 ADD = 0.34%
EA4 symbol GBPCAD.cz Magic Number= 2024 ADD = 1.88%
Selective ADM EA running in EURUSD.cz but could be running in all kind of symbols.
Close specific open orders and pending orders when ABSOLUTE DRAWDOWN of the entire account it´s x % of total balance = 8
In this situation when the entire account have a absolute drawdown of 8%, the Selective ADM EA close all orders and all pending orders ONLY in the symbol EURAUD.cz Magic Number= 2022 because it´s the highest (4.77%).
After close all orders and pending orders the EA2 should continue working and start open new trades.
The others EA must working normally.
So the the new absolute drawdown now is 1.01 + 4.77 - 4.77 + 0.34 + 1.88 = 3.23%
Some hours after we have a new situation:
Second time "cycle":
EA1 symbol EURUSD.cz Magic Number= 2021 ADD= 1.80%
EA2 symbol EURAUD.cz Magic Number= 2022 ADD = 1.15%
EA3 symbol USDCHF.cz Magic Number= 2023 ADD = 2.47%
EA4 symbol GBPCAD.cz Magic Number= 2024 ADD = 2.58%
Selective ADM EA running in EURUSD.cz but could be running in all kind of symbols.
Close specific open orders and pending orders when ABSOLUTE DRAWDOWN of the entire account it´s x % of total balance = 8
In this situation when the entire account have a absolute drawdown of 8%, the Selective ADM EA close all orders and all pending orders ONLY in the symbol GBPCAD.cz Magic Number= 2024 because it´s the highest (2.58%).
After close all orders and pending orders the EA4 should continue working and start open new trades.
The others EA must working normally.
So the the new absolute drawdown now is 1.80 + 1.15 + 2.47 + 2.58 - 2.58 = 5.42%
So in a trading week we can have several times or "cycles". If we have a week with low volatility maybe we have 0 or 1 times close trades "cycle"
but if we have high volatility in the markets the Selective ADM EA will work more and we will have several times "cycles".
General details about EA:
To calculate absolute drawdown balance and inicial deposit are the same.
This EA should working in all types of trading accounts (cent, micro, ECN, PRO...).
Maximum currency pairs to track = 16.
The EA should run in Forex Commodities (metals and energy) Indexes, Shares and Cryptocurency markets.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
INPUTS TABLE SUGGESTION (13 imputs in total):
MAIN:
Symbols to operate = (example: EURUSD.cz,EURAUD.cz,USDCHF.cz,GBPCAD.cz)
Magic numbers to operate = (example: 2021,2022,2023,2024)
Suffix of the currency pairs = (example: EURUSD.cz = .cz)
Count commission and swap = True / False
Refresh interval in seconds = from 0.1 to 10.
Enable autotrading after close orders and pending orders in a specify symbol or magic number = True / False
(note: after close orders in a specify symbol or magic number the EA should restart and start new trades)
CONDITION:
Close specific open orders and pending orders when ABSOLUTE DRAWDOWN of the entire account it´s x % of total balance = value from 00.01 to 99.99
ACTIONS (when the value of the condition is fulfilled):
Close all orders and all pending orders ONLY from the SYMBOL with the HIGHEST ABSOLUTE DRAWDOWN = True / False
Close all orders and all pending orders ONLY from the MAGIC NUMBER with the HIGHEST ABSOLUTE DRAWDOWN = True / False
Close all orders and all pending orders ONLY from the COMMENT with the HIGHEST ABSOLUTE DRAWDOWN = True / False
MISCELLANEOUS:
Send eMail when the value of the condition is fulfilled = True / False
Send push notification when the value of the condition is fulfilled = True / False
Send alerts when the value of the condition is fulfilled = True / False
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TESTING AFTER CODING:
When the developer finnish his work must test it one week from sunday to saturday before send to the client or if he haven´t condition to do that the client have 2 weeks to test the coding.
This job only be finnish and close after 2 weeks of testing without any issues. If the client find any issue the developer should fix as soon as possible.
After 2 weeks of testing the developer send the mq4 file and the client close successfully this job.
Note: To remmenber what is the absolute drawdown please open jpg attached.