MQL5 EA based on Automated Trade closures and re-entries at specific levels

Specification

Codex Shield Expert Advisor V1

Objective:
Create a MetaTrader 5 (MT5) Expert Advisor (EA) that acts as a protective shield for manually placed trades. The EA will manage open trades based on strict price movement rules, ensuring minimal losses and precise re-entries.


Core Logic Overview

1. Manual Trade Anchoring

  • Bot only activates after a manual trade is opened.

  • Uses the original manual entry price as the anchor.

  • Anchor price never changes unless a new manual trade is opened.

  • One active trade per symbol (per currency pair) at a time.


2. Trade Closing Logic

  • If price moves against the trade by 3 pips from the anchor, bot must close the trade immediately.

  • Precise closure rules:

    • BUY trade: Close if price drops 3 pips below entry.

    • SELL trade: Close if price rises 3 pips above entry.

  • Closure must happen exactly at 3 pips.


3. Re-Entry Logic

  • After closing a trade, bot waits for price to cross back favourably through the original entry price.

  • Re-entry conditions:

    • BUY trade: Reopen if price crosses 2 pips above the original entry price.

    • SELL trade: Reopen if price crosses 2 pips below the original entry price.

  • Reopened trades must use the same lot size as the original manual trade.


4. One Trade Per Currency Pair

  • Bot must only manage one active trade per currency pair.

  • Multiple pairs can be managed independently.


5. Passive Mode if Price Moves Away

  • If price moves further away from the entry after closure, bot does nothing.

  • Bot will only react again if price returns to entry level.

  • Bot remains passive until:

    • Price crosses the re-entry level.

    • Or a new manual trade is opened (resets anchor).


6. 24/7 Auto Operation

  • Bot operates continuously without manual interaction.

  • Must react instantly even during high volatility or fast price movements.


7. Take Profit Respect

  • After re-opening a trade, bot must assign the same Take Profit (TP) as the original manual trade.

  • TP must always be preserved for all re-entries.


8. Graphical User Interface (GUI) Panel

  • Display real-time status per currency pair:

    • If trade is active and in profit: "Trade in Profit"

    • If trade was closed and waiting for re-entry: "Trade Closed, Waiting for Re-Entry"

    • If no manual trade yet: "Waiting for Manual Entry"

  • Display status for multiple pairs independently:

    • Example:

      • EURUSD: Trade in Profit

      • XAUUSD: Waiting for Re-Entry


9. Chart Visuals

  • White dotted line at the anchor (entry) price when manual trade is opened.

  • Red line at stop-loss level (closure trigger):

    • BUY trade: 3 pips below entry.

    • SELL trade: 3 pips above entry.

  • Blue line at re-entry level:

    • BUY trade: 2 pips below original entry.

    • SELL trade: 2 pips above original entry.


10. Sound Alerts

  • Play a sound (" operationinicialized.wav ") every time a manual trade is opened.


11. Post Take Profit Behavior

  • After hitting Take Profit, bot must:

    • Shut off management for that symbol.

    • Wait for the next new manual trade to reset and restart.



















Responded

1
Developer 1
Rating
(35)
Projects
48
19%
Arbitration
3
67% / 0%
Overdue
8
17%
Busy
2
Developer 2
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
3
Developer 3
Rating
(221)
Projects
227
29%
Arbitration
0
Overdue
3
1%
Free
Published: 2 codes
4
Developer 4
Rating
(4)
Projects
5
0%
Arbitration
0
Overdue
2
40%
Free
5
Developer 5
Rating
(18)
Projects
24
13%
Arbitration
3
67% / 0%
Overdue
2
8%
Working
6
Developer 6
Rating
(2)
Projects
2
0%
Arbitration
1
0% / 0%
Overdue
2
100%
Working
Published: 1 code
7
Developer 7
Rating
(385)
Projects
409
30%
Arbitration
64
20% / 69%
Overdue
52
13%
Working
Similar orders
I am looking for an experienced and reliable MQL5 developer to complete an Expert Advisor (EA) project that is already partially developed. The previous coder abandoned the project close to completion, so I need someone who can step in, quickly understand the existing code, and professionally bring it across the finish line
📜 HostGhost EA Final Job Invite – For MQL5.com 📋 Project Title: Finalize & Polish HostGhost Dynamic Trader EA (80% Completed) 🌟 Project Description: Hello Developers, I am seeking an experienced and detail-oriented MQL5 programmer to finalize and polish a nearly completed EA called HostGhost . 80% of the EA's architecture is already built — structured, modular, well-commented, and elegantly laid out. Your role
Hello, I need an expert coder who can help me convert my tradingview pine script to mt5 EA expert advisor, This is the pine script https://ctxt.io/2/AAB4SyWXFQ Also I need for EA to enter trades exactly like this strategy on TradingView, i attach, please i need someone wo can do the work not time waster, Live market order should be placed on green and red indicator chart
I’m looking for a custom indicator that can scan for ICT Smart Money "Breaker Structures" and alert me when they form. What I Need: The indicator should analyze markets (Oil/Gold/ but mostly Crypto (BTC)) for Breaker Structures—where price breaks a swing high/low but gets rejected, signaling a potential reversal. I primarily use TradingView, so I'd appreciate it if the script is compatible with TradingView and can
Fast 1 30 - 150 USD
Job Title: MT5 Expert Advisor for ICT Strategy with Fair Value Gap and Risk Management Job Description: I’m looking for a skilled MQL5 developer to create an MT5 Expert Advisor (EA) based on an ICT-style strategy that trades XAUUSD using multi-timeframe market structure and Fair Value Gap detection. Key features: 4H market direction using BOS/CHOCH 2H/1H detection of FVGs (gap between candle 1’s high and candle 3’s
Hi programmer, create me the best ever trading robot that works on all brokers and platforms MT4 & MT5 works on all timeframes, must be able to open lot size of 0.01 to 5.00 trading forex, currency pairs,indices,crypto currencies also precious metals.The bot should be able to open 500 positions just in 10minutes 99.9% accurate buy and sell 100% automated hands free, trading robot auto TP & SL should able to trade
Create an EA based on trend following where entries are triggered on new highs and lows for the day based on 15 min candles. Include an input to limit the number of entries, also EA should trade 2 pairs xauusd and u30
The ea should include indicators and should be able to spot entries on a 1 minute /15 minutes time frame, it has to scalp and automatically add take profit and stop loss the bot must trade small accounts from 12USD
The process will be very simple, consisting of a buy and sell signal with a success rate of 92% to 95%. This signal must be accurate and free of any repainting or other fraudulent elements, as it will be tested on a live chart on the short-term timeframe (M1), as shown in the image. Experts with extensive experience in this field, or those with previous experience working with secret societies, corporations, and
I am looking for an experienced MQL4 developer to create a rebate farming Expert Advisor (EA) designed to consistently generate a minimum of 2 lots per day on a $500 account with low drawdown and safe logic . The primary goal is volume generation , not profitability — the EA should be optimized to maximize trade count or lot turnover for rebate/cashback purposes, while maintaining account safety. 🧠 Requirements

Project information

Budget
50 - 70 USD
Deadline
from 2 to 7 day(s)

Customer

Placed orders3
Arbitrage count1