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

指定

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.)



    応答済み

    1
    開発者 1
    評価
    (15)
    プロジェクト
    34
    24%
    仲裁
    4
    0% / 50%
    期限切れ
    2
    6%
    仕事中
    2
    開発者 2
    評価
    (3)
    プロジェクト
    3
    0%
    仲裁
    2
    0% / 50%
    期限切れ
    1
    33%
    取り込み中
    3
    開発者 3
    評価
    (21)
    プロジェクト
    30
    57%
    仲裁
    0
    期限切れ
    1
    3%
    仕事中
    4
    開発者 4
    評価
    プロジェクト
    0
    0%
    仲裁
    0
    期限切れ
    0
    5
    開発者 5
    評価
    (265)
    プロジェクト
    596
    35%
    仲裁
    64
    20% / 58%
    期限切れ
    147
    25%
    パブリッシュした人: 1 article, 22 codes
    6
    開発者 6
    評価
    プロジェクト
    0
    0%
    仲裁
    0
    期限切れ
    0
    7
    開発者 7
    評価
    (2)
    プロジェクト
    2
    0%
    仲裁
    1
    0% / 0%
    期限切れ
    1
    50%
    仕事中
    8
    開発者 8
    評価
    (8)
    プロジェクト
    11
    9%
    仲裁
    3
    33% / 33%
    期限切れ
    4
    36%
    取り込み中
    9
    開発者 9
    評価
    (306)
    プロジェクト
    549
    35%
    仲裁
    79
    32% / 42%
    期限切れ
    197
    36%
    取り込み中
    10
    開発者 10
    評価
    (144)
    プロジェクト
    186
    41%
    仲裁
    24
    58% / 21%
    期限切れ
    13
    7%
    11
    開発者 11
    評価
    (494)
    プロジェクト
    958
    74%
    仲裁
    27
    19% / 67%
    期限切れ
    100
    10%
    多忙
    パブリッシュした人: 1 article, 6 codes
    12
    開発者 12
    評価
    プロジェクト
    0
    0%
    仲裁
    0
    期限切れ
    0
    13
    開発者 13
    評価
    (6)
    プロジェクト
    8
    0%
    仲裁
    8
    13% / 88%
    期限切れ
    0
    14
    開発者 14
    評価
    (77)
    プロジェクト
    241
    73%
    仲裁
    7
    100% / 0%
    期限切れ
    1
    0%
    15
    開発者 15
    評価
    プロジェクト
    0
    0%
    仲裁
    1
    0% / 100%
    期限切れ
    0
    類似した注文
    Looking for an experienced Pine Script v5 & MQL5 developer to connect a custom TradingView indicator to MT5 (Exness) . The indicator already calculates lot size and includes a dropdown (None / Buy / Sell) . When Buy or Sell is selected, a TradingView alert must trigger , send lot size + direction via webhook , and place a market order in MT5 . No strategy conversion. No SL/TP handling. Execution only. Apply only if
    I’m looking for a skilled MQL5 developer to help build and manage an automated trading system that bridges TradingView custom indicator alerts to an Exness MT5 account . This role involves capturing Buy/Sell signals and lot sizes from TradingView webhooks , processing them with a Python listener , and executing orders on MT5 hosted on a 24/7 VPS . The ideal candidate will ensure accurate trades, reliable execution
    I need a trading signals indicator. So I can learn how to upgrade my trading skills and mentality. I will be very glad if I can upgrade my trading mentality
    I am looking for an experienced MQL5 developer to help build and support an automated trade execution system that connects TradingView custom indicator alerts to an Exness MT5 account. The role involves receiving TradingView webhook signals containing Buy/Sell direction and dynamically calculated lot size, processing them via a Python-based webhook listener, and executing market orders on MT5 running on a 24/7
    HELLO EVERYONE , I NEED AAN INDICATORE AND EA ON STOCHESTIC OSSILATOR, WHICH CAN GIVE ME ALERT WHEN SIGNAL APEARS, INDICAOTRE I CAN SHOW ON TRADING VIEW , EXACTLTY THAT INDICATORE I NEEDED.INDICATORE NAME ON TRADING VIEW( JL STOCHESTIC DIVERGENCE ALERT).. THANK YOU
    //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ #property strict // Inputs input int EMA_Fast = 9; input int EMA_Slow = 21; input int RSI_Period = 14; input double Lots = 0.1; input int StopLoss = 20; // وقف خسارة (بـ نقاط) input int TakeProfit = 40; // هدف (بـ نقاط)
    Indicator 130+ USD
    To trade Forex and pass FTMO challenges by combining: Smart Money Concepts (SMC), RSI divergence and Strict filtering to avoid overtrading and drawdown. If you’re experienced in this let me know. Thank you very much
    // Add this to your EA after ExportState() function void SendToBase44(const string state, const string dir, double entry, double sl, double tp) { string url = " https://preview-sandbox--ee0a32a725b788974de435e8cef40b7a.base44.app/api/functions/receiveEAState "; string headers = "Content-Type: application/json\r\n"; string json = "{" "\"symbol\":\""+_Symbol+"\","
    Hello! I am looking for an experienced, top-rated developer to build highly profitable strategy software that provides accurate signals for both long-term and short-term trades. The software must analyse the market correctly, indicating when to enter and where to set Take Profit (TP) and Stop Loss (SL) levels. It must deliver accurate results across all markets, including Forex, cryptocurrencies, metals, indices, and
    I would like an experienced developer to work with. I have an existing EA I would like to modify. The EA works well on demo account but for some reasons, is not profitable on live account. I want an experienced developer to optimise it for a live account. Note: I only have a trial version of the EA, I do not have the source code

    プロジェクト情報

    予算
    50 - 200 USD

    依頼者

    (1)
    出された注文2
    裁定取引数0