指定
A SPECIFICATION: NESTED MULTI-TIMEFRAME MOMENTUM (NMTM)
1. CORE OBJECTIVE
The EA is designed to identify institutional Supply and Demand zones on the
H4 timeframe that are "nested" within Daily (D1) zones. It filters for high-
momentum "Leg-Out" moves and only trades in the direction of the Daily
trend.
2. PHASE 1: TREND & CONTEXT FILTERS (DAILY)
The EA must first confirm the Daily bias. No H4 zones are valid if they
contradict the D1 trend.
A. Trend Definition
• Bullish Trend (Longs Only): * 20 EMA is above the 50 SMA.
• Current Price is above the 50 SMA.
• Bearish Trend (Shorts Only): * 20 EMA is below the 50 SMA.
• Current Price is below the 50 SMA.
• Trend Invalidation: If the Daily price closes on the opposite side of the 50
SMA, the trend is considered finished, and all pending limit orders for that
direction must be cancelled.
B. Higher Timeframe (HTF) Nesting
• H4 Demand: The H4 zone (High to Low) must be physically located within
the boundaries of a Daily Demand Zone.
• H4 Supply: The H4 zone (High to Low) must be physically located within
the boundaries of a Daily Supply Zone.
3. PHASE 2: H4 ZONE IDENTIFICATION (THE BASE)
The EA identifies the "Base" using four specific price action formations:
1. RBR (Rally-Base-Rally): Bullish continuation.
2. DBR (Drop-Base-Rally): Bullish reversal.
3. DBD (Drop-Base-Drop): Bearish continuation.
4. RBD (Rally-Base-Drop): Bearish reversal.
The Base Span: Defined as the vertical distance (in pips) between the
highest high and lowest low of the consolidation candles (the "Base") before
the explosive move.
4. PHASE 3: THE "EXPLOSIVE LEG-OUT" QUALITY CONTROL
A zone is only valid if the candle that exits the base (the "Leg-Out")
represents an abnormal institutional footprint.
A. Momentum Ratio (The 70% Rule)
The Leg-Out candle must have a high body-to-range ratio to ensure minimal
price rejection (small wicks).
• Formula: \frac{|Open - Close|}{High - Low} \ge 0.70
• Note: The candle body must represent at least 70% of the total candle
range.
B. Size Requirement
The Leg-Out candle must be "abnormally larger" than the candles forming
the Base. (Recommended: at least 2x the average size of the previous 3
candles).
5. PHASE 4: THE "FOLLOW-THROUGH" (3X MOVE VALIDATION)The EA will not place a limit order immediately. It must wait for the move
to "complete" to verify the profit potential.
1. Move Tracking: Monitor the sequence of candles following the Leg-Out
that are the same color as the Leg-Out.
2. Termination: The "Move" ends when a candle of a different color closes.
3. The 3x Validation Rule:
• Calculation: Total distance of the move (from the edge of the Base to the
highest/lowest point of the same-colored sequence).
• Requirement: The Move must be at least 3 times the size of the Base
Span.
• Logic: MoveDistance \ge (BaseSpan \times 3)
6. PHASE 5: EXECUTION & TRADE MANAGEMENT
A. Entry (Limit Orders Only)
• Buy Limit: Placed at the Proximal Line (top) of the H4 Demand Base.
• Sell Limit: Placed at the Proximal Line (bottom) of the H4 Supply Base.
B. Stop Loss (SL)
• Long: Placed at the Distal Line (bottom) of the H4 Demand Base.
• Short: Placed at the Distal Line (top) of the H4 Supply Base.
C. Order Invalidation
• Delete the Limit Order if the Daily trend changes (Price closes on the
wrong side of 50 SMA).
• Delete the Limit Order if price returns to the zone and "touches" it before
the 3x move was completed.
Summary of Mathematical Constraints for Developer:
• Trend: (EMA20 > SMA50) && (Close > SMA50) = Longs Only
• Candle Quality: Body / (High - Low) >= 0.7
• Reward/Risk Potential: Move_Sequence_Pips >= (Base_Pips * 3)
And SL 33% SL buffer on H4 chart
Stoplossto BE function with R multiples / Take profit R multiples
calculate position size based on dollar risk