Gold Momentum Scalper MT5
- Experts
- Versione: 1.32
- Attivazioni: 20
Gold Momentum Scalper MT5 operates as an automated scalping system built on a combination of trend filtering (EMA) and momentum acceleration (RSI), specifically engineered for the volatility profile of XAUUSD (Gold) (while remaining compatible with major currency pairs such as EURUSD and GBPUSD). The system integrates dynamic risk management (Auto-Lot) with real-time, tick-by-tick multi-stage profit protection.
1. Market Analysis Logic & Entry Triggers
The EA evaluates market conditions only once upon the formation of a new candle (closed-candle confirmation) to filter out false signals caused by intra-bar price spikes (whipsaws) and prevent overtrading within a single bar.
-
BUY Signal:
-
Bullish Trend Filter: EMA 21 is positioned above EMA 50.
-
Price Action Confirmation: The previous candle closed bullish (Close > Open ) above the EMA 21 line.
-
Momentum Trigger: The RSI (14) crosses upward above the 50 midline (RSI[2] <= 50 and RSI[1] > 50 ).
-
-
SELL Signal:
-
Bearish Trend Filter: EMA 21 is positioned below EMA 50.
-
Price Action Confirmation: The previous candle closed bearish (Close < Open ) below the EMA 21 line.
-
Momentum Trigger: The RSI (14) crosses downward below the 50 midline (RSI[2] >= 50 and RSI[1] < 50 ).
-
2. Automatic Position Sizing (Auto-Lot & Even Rounding)
Before executing an order with an initial 1:2 Risk-to-Reward ratio (20-pip Stop Loss / $2.00 on XAUUSD and 40-pip Take Profit / $4.00 on XAUUSD), the EA calculates the exact trade volume:
-
Risk-Percentage Based: Computes the actual monetary loss per 1.0 lot from the entry price to the 20-pip Stop Loss level using the broker's native calculation (OrderCalcProfit ), then scales the volume according to the defined capital risk percentage (default 1% of Account Balance or Equity).
-
Even-Step Rounding: Volume is rounded down to an even multiple (2 × SYMBOL_VOLUME_STEP , e.g., 0.02 , 0.04 , 0.06 ). This ensures the actual risk never exceeds the configured 1% threshold while guaranteeing that the position can always be split cleanly in half when the 50% Partial Close feature is enabled.
-
Margin & Broker Volume Limit Validation: Automatically adjusts lot sizes to fit within available Free Margin (retaining a 5% safety buffer) and the broker's maximum symbol volume limit (SYMBOL_VOLUME_LIMIT ).
3. 3-Stage Position Management Cycle (Real-Time Tick)
Once an order is opened, the ManageOpenPositions() module monitors price movements on every incoming tick to secure profits progressively:
| Price Movement Stage | Trigger Condition | Automated EA Action | Risk Management Objective |
|---|---|---|---|
| 0. Order Execution | Valid signal & Spread ≤ 3.5 pips | Sets initial 20-pip SL & 40-pip TP | Caps maximum downside risk from the moment of entry. |
| 1. Break-Even (BE) | Profit reaches +15.0 pips | Moves SL to Entry Price + 1.5 pips | Eliminates downside exposure (risk-free trade) while covering commissions and slippage. |
| 2. Partial Close | Profit reaches +20.0 pips | Closes 50% of the lot volume automatically | Locks in half of the floating gain as realized account balance. |
| 3. Trailing Stop | Profit ≥ +20.0 pips (continuous) | Trails the remaining 50% volume at a 12-pip distance behind price (stepping every 2 pips) | Maximizes profit potential toward the 40-pip TP while protecting gains against sudden reversals. |
4. Protection Filters & Execution Compatibility
-
Spread Filter ( InpMaxSpreadPips = 3.5 ): Blocks new entries during abnormal spread widening (such as high-impact news releases or daily market rollover).
-
Automatic Pip Calibration ( GetPipSize ): Automatically detects whether the symbol uses 2-decimal XAUUSD (2650.50 ), 3-decimal XAUUSD (2650.500 ), or 3/5-decimal Forex pricing so that 20-pip and 40-pip distances remain accurate across all brokers.
-
Stops Level & Freeze Level Protection: Before modifying any Stop Loss, the EA verifies safe distances relative to the current market price, active SL, and active TP (plus a 10-point safety buffer) to prevent order modification rejections from broker servers or MQL5 Market automated validation checks.
