MT5 EA (Hedging) — XC + WAD + Keltner 3-Leg System with Strong/Weak Entries + Re-entry Lockout + Visual Indicators + Retracement Entry Option

MQL5 Göstergeler Uzman Danışmanlar

İş Gereklilikleri

Overview

I need an MT5 Expert Advisor (MQL5) for a mechanical trading system.
It is a hedging account and must run as a true 3-position (3-leg) system (3 separate positions), not partial closes.

The EA must match my rules exactly and behave consistently in Strategy Tester and live charts (bar-close signal logic, no forward-looking).

Timeframe / Execution

  • Signal timeframe: input
  • All signals are evaluated on the last closed candle (bar1).
  • Strong signals execute at the open of the new candle (market order at bar0 open).
  • Weak signals are 1-candle expiry stop orders (virtual is fine, but must replicate stop behavior).

Indicators (EA must calculate internally from OHLC)

1) XC (Expansion/Contraction)

EA must compute:

  • XC Short+ (PositiveShort)
  • XC Short- (NegativeShort)
  • XC Long+ (PositiveLong)
  • XC Long- (NegativeLong)

2) WAD (Williams Accumulation/Distribution), WAD SMA

3) Keltner Channel (TradingView style)

Must match TradingView settings:

Entry Rules (Signals on bar t = bar1)

Strong Buy

Weak Buy (1-bar expiry STOP)

Strong Sell

Weak Sell (1-bar expiry STOP)

Reversal Handling (Important)

If there is an opposite direction trigger, the EA must:

  1. Close all current legs immediately at market
  2. Then open the opposite direction trade
    Weak reversal only happens if the weak stop actually triggers.

Also handle edge case:

  • If a weak stop from day t triggers on day t+1 AND day t+1 is also a strong signal day, the weak stop fill price takes priority (stop filled intrabar), not the strong close/open price.

3-Leg Trade Management

When trade opens, open 3 separate positions with same SL but different exits.

Define risk unit:

  • R = KC(20,1) width = KC_upper(20,1) - KC_lower(20,1) on signal candle (bar1)

Stop Loss:

  • Long SL = entry - R
  • Short SL = entry + R

Leg exits:

  • Leg 1 TP1 = entry ± 1R
  • Leg 2 TP2 selectable by input:
    • Mode A: 2R
    • Mode B: KC(20,3) value from previous candle (bar1):
      • Long TP2 = KC upper(20,3)[bar1]
      • Short TP2 = KC lower(20,3)[bar1]
  • Leg 3 TP3 trailing:
    • TP3 activates once price reaches 3R.
    • After 3R, trail by 25% retracement from best extreme since TP3 activation (keep 75% profit):
      • For long: keep level = entry + 0.75*(highestHighSince3R - entry)
      • For short: keep level = entry - 0.75*(entry - lowestLowSince3R)
    • Stop should only tighten, never loosen.

Optional input:

  • MOVE_BE_AFTER_TP1 (default true): after TP1 hits, move SL of legs 2 & 3 to breakeven.

Re-entry Lockout Logic (Very Important)

When flat, re-entry is restricted depending on how last trade closed:

If last trade did NOT hit TP3

Use XC Long series lockout:

  • After a LONG trade: must see XC Long- > XC Long+ (bear phase) and then later XC Long+ > XC Long- (bull phase) before allowing new LONG trades. Until then, only SHORT setups are allowed.
  • After a SHORT trade: must see XC Long+ > XC Long- then later XC Long- > XC Long+ before allowing new SHORT trades. Until then, only LONG setups are allowed.

If last trade DID hit TP3

Use XC Short series lockout instead (same two-step flip logic).

This must be coded as a small state machine (phase0 → phase1 → unlock).

Risk Sizing

Inputs:

  • Capital M (e.g. 100000)
  • Risk percent N (e.g. 1%)
  • EA risks N% of M per trade, then splits into 3 legs automatically.

Must respect symbol min lot / step / max.

Visual Requirements (Strategy Tester)

When EA attached in Strategy Tester Visual mode:

  • Apply chart template-like settings:
    • White background, black foreground
    • Bull candles white, bear candles black
    • Bar up/down black
    • Grid OFF
  • Add indicators automatically (or embed indicator plots inside EA):
    • XC with:
      • Short+ green line, Short- red line
      • Long area fill: green when Long+>Long-, red when Long->Long+
    • WAD with:
      • WAD green when WAD>WAD_SMA, red when WAD<WAD_SMA
      • WAD_SMA black

    NEW ENTRY METHOD OPTION: “Retracement Entry” (Trail-from-trigger, not fixed % of R)

    Add an optional entry mode that replaces immediate entry with a retracement limit order.

    Inputs

    • USE_RETRACEMENT_ENTRY (bool)
    • RETRACE_PCT (double, e.g. 0.50 for 50%)

    When retracement is enabled

    A “trigger event” still occurs (Strong signal or Weak trigger). On trigger:

    1. If holding opposite direction positions, close ALL 3 legs immediately at market.
    2. Do NOT enter immediately. Instead, start tracking the move from the trigger and place a retracement limit order derived from the post-trigger extreme.

    What counts as a “trigger event”

    • Strong Buy/Sell trigger: conditions met on bar1 close (normal strong signal timing).
    • Weak Buy/Sell trigger: only when the 1-bar expiry stop is actually hit intrabar (weak setups that don’t trigger do nothing).

    How retracement price is computed (trail-from-trigger extreme)

    Define:

    • TriggerPrice = the normal entry reference for that signal
      • Strong: Close(bar1) (or the system’s strong reference price)
      • Weak: the weak stop trigger price (e.g., 1.0015*Close(bar1) or 0.9985*Close(bar1))

    After the trigger event, track the best extreme since trigger:

    For LONG retracement

    • Track ExtremeHigh = highest high since trigger
    • Compute candidate retrace price:
      • Q = ExtremeHigh - RETRACE_PCT * (ExtremeHigh - TriggerPrice)
    • If Q > TriggerPrice, then queue at TriggerPrice instead (cap it):
      • Q = TriggerPrice
    • Place BUY LIMIT at Q

    For SHORT retracement

    • Track ExtremeLow = lowest low since trigger
    • Compute candidate retrace price:
      • Q = ExtremeLow + RETRACE_PCT * (TriggerPrice - ExtremeLow)
    • If Q < TriggerPrice, then queue at TriggerPrice instead:
      • Q = TriggerPrice
    • Place SELL LIMIT at Q

    One critical cancellation rule

    If price reaches TP1 level (defined by the system) before the retracement limit order is filled, then:

    • Cancel the limit order
    • Treat the setup as “missed” (no position opens)

    Exits stay based on the trigger reference (NOT the fill price)

    Even though the fill may be better/worse, the SL/TP levels remain exactly as if we entered at TriggerPrice:

    • R = KC(20,1)[bar1] width
    • SL = TriggerPrice ± 1R
    • TP1 = TriggerPrice ± 1R
    • TP2 = TriggerPrice ± 2R OR KC(20,3)[prev] depending on mode
    • TP3 activates at TriggerPrice ± 3R and trails per TP3 rules

    Very important: lockout/re-entry logic must run on “trigger”, even if no fill happens

    The system’s Re-entry Lockout Logic must continue running as if a trade “event” happened, even if the retracement limit never gets filled.

    So the EA must record the trigger direction and trigger time and use it to update lockout state exactly as if the trade was taken.

    Re-entry Lockout Logic (must remain intact):

    If last trade/trigger did NOT hit TP3

    • Use XC Long series lockout
      • After a LONG: require XC Long- > XC Long+ then later XC Long+ > XC Long- before allowing LONG again
      • After a SHORT: require XC Long+ > XC Long- then later XC Long- > XC Long+ before allowing SHORT again

    If last trade/trigger DID hit TP3

    • Use XC Short series lockout instead (same two-step flip logic)

    Additional edge cases the EA must handle

    • If an opposite trigger occurs while a retracement limit is pending:
      • Cancel the pending limit
      • Apply the opposite trigger rules (including close-all if needed)
      • Then start a new retracement tracking/limit for the new trigger


    Deliverables

    1. .mq5 EA source (clean, commented, no obfuscation)
    2. If needed: XC and WAD indicator source or integrated indicator plotting inside EA
    3. Must compile with 0 errors on latest MT5
    4. Instructions on where to place files and how to test

    Testing

    I will validate by:

    • Running Strategy Tester on the same symbol/timeframe and comparing trades to my Python backtest logic.

    I can provide:

    • Example trades / reference logs
    • The XC indicator source code (already have it)
    • Expected behavior in tricky cases (weak+strong same day, reversal same day, etc.)



    Yanıtlandı

    1
    Geliştirici 1
    Derecelendirme
    (15)
    Projeler
    34
    24%
    Arabuluculuk
    4
    0% / 50%
    Süresi dolmuş
    2
    6%
    Çalışıyor
    2
    Geliştirici 2
    Derecelendirme
    (3)
    Projeler
    3
    0%
    Arabuluculuk
    2
    0% / 50%
    Süresi dolmuş
    1
    33%
    Yüklendi
    3
    Geliştirici 3
    Derecelendirme
    (21)
    Projeler
    30
    57%
    Arabuluculuk
    0
    Süresi dolmuş
    1
    3%
    Çalışıyor
    4
    Geliştirici 4
    Derecelendirme
    Projeler
    0
    0%
    Arabuluculuk
    0
    Süresi dolmuş
    0
    Serbest
    5
    Geliştirici 5
    Derecelendirme
    (265)
    Projeler
    596
    35%
    Arabuluculuk
    64
    20% / 58%
    Süresi dolmuş
    147
    25%
    Serbest
    Yayınlandı: 1 makale, 22 kod
    6
    Geliştirici 6
    Derecelendirme
    Projeler
    0
    0%
    Arabuluculuk
    0
    Süresi dolmuş
    0
    Serbest
    7
    Geliştirici 7
    Derecelendirme
    (2)
    Projeler
    2
    0%
    Arabuluculuk
    1
    0% / 0%
    Süresi dolmuş
    1
    50%
    Çalışıyor
    8
    Geliştirici 8
    Derecelendirme
    (8)
    Projeler
    11
    9%
    Arabuluculuk
    3
    33% / 33%
    Süresi dolmuş
    4
    36%
    Yüklendi
    9
    Geliştirici 9
    Derecelendirme
    (306)
    Projeler
    549
    35%
    Arabuluculuk
    79
    32% / 42%
    Süresi dolmuş
    197
    36%
    Yüklendi
    10
    Geliştirici 10
    Derecelendirme
    (144)
    Projeler
    186
    41%
    Arabuluculuk
    24
    58% / 21%
    Süresi dolmuş
    13
    7%
    Serbest
    11
    Geliştirici 11
    Derecelendirme
    (494)
    Projeler
    958
    74%
    Arabuluculuk
    27
    19% / 67%
    Süresi dolmuş
    100
    10%
    Meşgul
    Yayınlandı: 1 makale, 6 kod
    12
    Geliştirici 12
    Derecelendirme
    Projeler
    0
    0%
    Arabuluculuk
    0
    Süresi dolmuş
    0
    Serbest
    13
    Geliştirici 13
    Derecelendirme
    (6)
    Projeler
    8
    0%
    Arabuluculuk
    8
    13% / 88%
    Süresi dolmuş
    0
    Serbest
    14
    Geliştirici 14
    Derecelendirme
    (77)
    Projeler
    241
    73%
    Arabuluculuk
    7
    100% / 0%
    Süresi dolmuş
    1
    0%
    Serbest
    15
    Geliştirici 15
    Derecelendirme
    Projeler
    0
    0%
    Arabuluculuk
    1
    0% / 100%
    Süresi dolmuş
    0
    Serbest
    16
    Geliştirici 16
    Derecelendirme
    (4)
    Projeler
    7
    0%
    Arabuluculuk
    3
    33% / 33%
    Süresi dolmuş
    3
    43%
    Yüklendi
    Benzer siparişler
    New EA Urgent! 30+ USD
    greetings,i am currently looking for a good programmer to help me develop a custom ea using a custom indicator,the strategy will be based on currency correlation,the ea should also have a break even stop loss...thank you
    Hi There, I have an indicator which i am using to take trades manually and looking to automate trades through EA. Reach out to discuss further on this work. Cheers
    We are looking to acquire an existing, profitable EA that trades using price action–based logic . The EA must operate as a day-trading system with proper Stop Loss and Take Profit , and must NOT use grid, martingale, or high-frequency scalping . This is a buyout request — we want to purchase the complete strategy along with the full source code . We are not looking to develop a new EA from scratch
    Build a low-latency, event-driven trading bot for Polymarket esports markets that ingests real-time PandaScore LoL match events , converts them into dynamic win-probability estimates , detects micro-latency mispricing opportunities , and executes short-hold automated trades , with an architecture designed to scale later to Dota 2 and CS2
    Hola, Necesito un EA o sistema que me permita copiar operaciones de una cuenta de origen (demo, inversor o real) a una cuenta real , con ciertas reglas específicas que detallo a continuación: Requisitos Tipo de órdenes: La cuenta de origen puede abrir operaciones como Buy Stop o Sell Stop , pero en la cuenta real quiero que se abran órdenes de mercado al instante , tan pronto la operación se activa en la cuenta de
    I will develop a custom MetaTrader 5 Expert Advisor based on the client’s provided trading rules. The EA will include proper entry and exit logic, stop loss and take profit handling and stable risk management. The code will be clean, non-repainting, MT5 compliant, and delivered with full source files. "Risk Disclosure : Trading in financial markets involves risk, and results depend on market conditions, broker
    I'm looking for someone who can create a EA for an existing MT5 indicator. The goal is to have the EA execute orders when the indicator gives a signal. I already have the SC to the indicator. I would prefer an EA that can be added to the existing Indicator. Message me for more details
    I need a professional developer to build a Telegram-to-MetaTrader trade copier system. Project overview: - A Telegram bot will read trade signals from a Telegram channel - Trades will be automatically executed on MT4 and/or MT5 accounts - The system must support copying trades to multiple MetaTrader accounts - Execution should work even when the user is offline Functional requirements: - Structured signal format
    Robot mt5 30 - 120 USD
    Urgent! I need a bot like the one in the video for the MT5 platform, working the same way on a real account. Please watch the video as soon as possible
    I need a MetaTrader 5 Expert Advisor (EA) built based on a clear, rule-based strategy for XAUUSD on the M5 timeframe. Indicators used: EMA 50 (Exponential, Close) EMA 200 (Exponential, Close) RSI (14) Stochastic Oscillator (14,3,3) BUY rules: Price above EMA 50 and EMA 200 RSI between 10 and 25 Stochastic crosses upward from below 20 Bullish candle close SELL rules: Price below EMA 50 and EMA 200 RSI between 80 and

    Proje bilgisi

    Bütçe
    50 - 200 USD

    Müşteri

    (1)
    Verilmiş siparişler2
    Arabuluculuk sayısı0