Auftrag beendet
Spezifikation
Below is the clean, typed, structured version of your handwritten requirements PLUS clear diagrams for MSS, Internal MSS, Structure Shift, SL & Trailing SL.
✅ Typed Version – MT5 EA Requirements (Internal MSS EA)
1. EA Logic – Core Criteria
-
When there is Market Structure Shift (MSS) or Internal MSS, the EA must take Buy or Sell positions.
-
Trades should only be activated after the candle closes beyond the MSS level.
-
MSS breakout must be detected based on candle close, not wicks.
-
Internal MSS must also be detected separately.
2. Stop-Loss Rules
2.1 Initial Stop Loss
-
SL = 5 pips below the structure Low for Buy trades.
-
SL = 5 pips above the structure High for Sell trades.
2.2 Trailing Stop Loss
-
Trailing SL must trail 5 pips below new Higher Lows (HL) in Buy trades.
-
Trailing SL must trail 5 pips above new Lower Highs (LH) in Sell trades.
-
The SL should move only when a new structural pivot forms (swing point).
3. Target Rules
-
Target is not fixed.
-
We hold the trade until:
-
A new internal MSS occurs against the position → Exit.
-
Or trailing SL is hit.
-
4. Symbols / Pairs
EA must work on:
-
All major currency pairs
-
XAUUSD (Gold)
-
NAS100 (US100)
5. Timeframes
The EA must work on:
-
5 min (M5)
-
15 min (M15)
-
1 hour (H1)
-
4 hour (H4)
And any other timeframe the user attaches it to.
6. Backtesting
-
EA must be very fast in backtesting.
-
Should not use heavy indicators.
-
Use simple MSS logic + candle data (efficient for Strategy Tester).
7. Adjustable MSS Sensitivity
-
MSS structure breakout bars must be adjustable input, for example:
-
Swing Length = 2, 3, 5 (user-defined)
-
MSS confirmation candle count adjustable
-
8. Execution Rules
-
Trades only after candle close MSS confirmation.
-
No repaint, no partial signals.
-
Internal structure shift detection should be accurate.
-
EA must run smoothly on all MT5 brokers.
9. Additional Conditions
-
MSS must be detected on candle close basis only.
-
EA must identify:
-
HH, HL, LH, LL
-
BOS (break of structure)
-
MSS (market structure shift)
-
Internal MSS (micro BOS inside internal leg)
-
📘 DIAGRAMS FOR PERFECT UNDERSTANDING
📌 1. Market Structure Basics
Uptrend
HH / HL / \ / HL ------> BUY AREA
Downtrend
LH
\
\ LL
\ /
LL ------> SELL AREA
📌 2. Market Structure Shift (MSS) – Bullish
Price breaks a previous Lower High with a displacement candle.
Downtrend: LH → LL → LH → LL MSS Break ▲ │ LL —— LH —— LL —─┘ ⟶ Strong bullish candle closes above LH
Meaning: Trend changes from downtrend → uptrend.
📌 3. Market Structure Shift (MSS) – Bearish
Price breaks a previous Higher Low with a displacement candle.
Uptrend: HL → HH → HL → HH
MSS Break
▲
│
HL —— HH —— HL —──────┘ ⟶ Bearish candle closes below HL
📌 4. Internal MSS (Micro Structure Shift)
Internal MSS occurs inside the bigger swing.
Bigger Swing (Downtrend) LH \ LL Inside this leg: mini-LH \ mini-LL \ mini-HH ← INTERNAL MSS
Internal MSS is used for early entry and trailing stop management.
📌 5. STOP LOSS Placement
Buy Trade
Internal MSS Break ↑
Entry → Buy
SL → 5 pips below latest Structure Low (HL)
HL
\
\ Entry ↑
\ |
\ |
\|_________
SL (HL - 5 pips)
Sell Trade
Internal MSS Break ↓ Entry → Sell SL → 5 pips above latest Structure High (LH)
📌 6. Trailing Stop Loss (TSL)
Buy Trade TSL Movement
HL1 → SL placed 5 pips below HL1 HL2 forms → SL moves to 5 pips below HL2 HL3 forms → SL moves to 5 pips below HL3
Diagram:
HH / HL3 / / HL2 / \/ HL1 → TSL moves step-by-step with new HLs.
Sell Trade TSL Movement
LH1 → SL placed 5 pips above LH1 LH2 forms → SL moves to 5 pips above LH2 LH3 forms → SL moves to 5 pips above LH3
📌 7. Entry Logic Diagram
Buy Entry
Downtrend → MSS → Uptrend MSS Break ▲ │ LL → LH → LL —─┘ (Bullish Break) ↑ Entry after candle close
Sell Entry
Uptrend → MSS → Downtrend
MSS Break ▼
│
HH → HL → HH —─┘ (Bearish Break)
↑ Entry after candle close
📌 8. Exit Logic Diagram
Exit when:
-
Opposite Internal MSS occurs, OR
-
Trailing SL is hit.
Buy Trade: HL1 → HL2 → HL3 Internal MSS Down → EXIT
✅ Your Typed Requirements + Perfect Diagrams Are Ready
If you want:
✔ Full MT5 EA Code
✔ With all MSS + Internal MSS logic
✔ Zero Errors
✔ Fast Backtesting
✔ Clean and Professional Code
Just say:
“Make full EA code now.”
I will deliver the complete, error-free EA in MQL5 format.