"Emergency Bailout" EA for MT4 needed

Experts

Job finished

Execution time 9 days
Feedback from employee
Very responsible customer.
Feedback from customer
I am happy! :-)

Specification

I need an Expert Advisor for MetaTrader 4 (not MT5).

This EA will continuously monitor two values in MT4: Account "Balance" and account "Equity" (Equity changes as floating drawdown or gain of all open trades changes, while Balance only changes after a trade is closed).

When Equity falls below a given percentage of Balance (this percentage is provided as a parameter to the EA), then the EA will immediately close only those open trades which are currently negative (trades which at that time produce a floating negative drawdown, not in floating positive gain). Open trades which are in floating positive gain or pending orders will never be touched.

A status e-mail will be sent when trades are closed by the EA. This e-mail will list the trades closed as well as Balance and Equity before and after the close.

The EA needs to be programmed extremely careful and with reliability in mind. Closing of positions must be repeated until successful. After 5 minutes of trying, an error message on screen and via e-mail must be generated while the EA will continue trying to close the trades indefinitely (except when the condition for closing the trades is not present any more because the floating drawdown has reduced).

In essence, this EA will provide an automatic "emergency bailout" if one or more trades threaten to blow up the account, while leaving positive trades untouched. After closing all of the negative trades, the EA will continue to run and will be ready to close other trades if the condition to do so is met again.

Regards,

D.


Edit: To clarify the action of the EA, here is an example, step by step over time:


1. There are EUR 10,000 in the account, no trades. I have set the percentage parameter for your EA to 50 %. 

2. Some other EA (not your EA) opens 3 trades. After one day, 2 of these trades are negative (floating DD) and one trade is positive (floating gain). All 3 trades are still open. This is how the account now looks - note Balance and Equity:

Trade 1: - 2,000 EUR

Trade 2: - 3,000 EUR

Trade 3: + 2,000 EUR

Balance: 10,000 EUR, Equity: 7,000 EUR

Balance is unchanged because no trade had been closed. Equity however is only 7,000 now because of the combination of floating DD and floating gain from the open trades. What your EA now needs to do is continuously calculate how many percent the current Equity is from the current Balance. In this case, this is currently 70 %. Action will only be taken by your EA when this percentage falls below the percentage given in the parameter.

Let's see how that happens:

3. A day later, the DD of Trade 2 gets worse, now it looks like this:

Trade 1: - 2,000 EUR

Trade 2: - 5,001 EUR

Trade 3: + 2,000 EUR

Balance: 10,000 EUR, Equity: 4,999 EUR

Now your EA calculates that Equity is only 49 % of Balance. That's less than the given parameter of 50 %. Now the EA will take action: It will immediately close ALL trades in the account which are in floating DD. So it will close Trade 1 und Trade 2, while it leaves Trade 3 untouched. After this action, this is how the account will look like (of cause I am ignoring slippage etc.):

Trade 3: + 2,000 EUR

Balance: 2,999 EUR, Equity: 4,999 EUR

The percentage calculated by the EA is now at 166.69 % and far away from the given 50 %. The EA will continue to run and will take action any time again when Equity drops below 50 % of Balance.

Edit: The EA must not close only one negative trade and then reevaluate. When the condition to close is met, ALL negative trades must be closed. Only after all these trades have been closed, the EA will start to evaluate again. That's necessary because else the floating DD would be reduced after closing the first negative trade and the remaining negative trades may not be closed. 

Edit: The EA must check for the condition on every tick (not only once a day). 

Responded

1
Developer 1
Rating
(73)
Projects
257
53%
Arbitration
16
50% / 38%
Overdue
83
32%
Free
2
Developer 2
Rating
(564)
Projects
845
73%
Arbitration
15
53% / 13%
Overdue
193
23%
Free
3
Developer 3
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
4
Developer 4
Rating
(27)
Projects
48
38%
Arbitration
6
17% / 50%
Overdue
30
63%
Free
Published: 12 articles, 1 code
Similar orders
I am looking for an experienced MQL5/MT5 developer to develop a custom Expert Advisor based on a complete technical architecture already prepared by the client. This is not a request to design a trading strategy from scratch . The strategy architecture, entry/exit concepts, filters, risk-management requirements and testing requirements are already documented. The main responsibility will be MQL5 development
EAs 100+ USD
To apply, you must already have your EA running on an active MT5 trading account connected to the market. The account must have genuine trading history that can be independently reviewed and verified. EA Requirements 1. Prop-Firm Compatible Risk Management - The EA must include daily and overall drawdown protection. - Required inputs: "MaxDailyLoss = 5%" "MaxTotalDrawdown = 10%" - Once either limit is
Strategy 40 - 60 USD
yo i have a strategy i would really like to turn into a signal bot basically please this is very technical and serious to me the strategy needs more time 1 time frame and the bot most be 100% accurate
Ready to use bot 100+ USD
seller must provide the following to be considered... i will answer to all who fit this description, and can purchase more than 1 EA... - brief strategy description - overall EA expectancy - 1 week limited trial version, with whatever settings you consider best (can be blocked on demo, i don't really care) - investor password from a reputable broker (if history is available... live / demo, same thing, doesn't really
I want you to develop a professional HFT trading robot for MT5/MQL5 , initially focused on XAUUSD . The robot should be designed for high-speed tick-level trading , analyzing real-time bid/ask movement, spread, tick velocity, momentum, volatility, price acceleration and short-term market microstructure to identify very short-term opportunities. The core strategy should be capable of opening 5–10+ positions in a
can you help me use a Tickblaze Algo NRBO on the NT platform? I have it somewhat set up, but I have other questions about running it & knowing how to operate it in NT. Thank you if anyone have experience in this kindly bib and let do it asap
I need a fully automated custom Expert Advisor for MetaTrader 5 (MQL5). The EA is intended for use on a The5ers $100,000 2-Step prop-firm account. IMPORTANT DELIVERY REQUIREMENT: I must receive the complete editable .mq5 source code as well as the compiled .ex5 file. Compiled-only delivery is NOT acceptable. The EA must be coded specifically for this project and must not copy trades, use external trading signals or
I've got a Pine Script from Trading View. I need help from a programmer who can help with optimising the strategy by 1) Adding a couple of further rules 2) Redesign the trading alert arrows & colours I need, please, a programmer who is 1) Good at Pine language 2) Has excellent after-job support (not for free though) 3) Possess the ability to work with others. 4) Able to deliver the job at the shortest possible time
I need an experienced TradingView Pine Script developer to build and test a custom intraday strategy for NQ/MNQ . I am not looking for a conversion . I need the strategy researched, developed, tested, and optimized based on my requirements. Requirements: NQ/MNQ intraday trading 5–15 minute charts New York session only Flat before market close Base logic using Zero Lag Signals , with additional filters if justified
Le robot devra : Respecter strictement les règles de risque des comptes FTMO : perte journalière maximale, perte maximale totale, taille des positions, etc. Intégrer un système de gestion du risque automatique. Être capable de gérer différents types de comptes et tailles de capital. Être basé sur ma stratégie et mes règles de trading que je fournirai au développeur. Être entièrement automatisé pour l’exécution des

Project information

Budget