Trend Impulse Runner A xau
- Experts
- Version: 1.20
Product Description (MQL5 Market)
Name: EA XAU Trend Impulse Runner A (Modern) v1.20
Type: Expert Advisor (automated trading)
Instrument: XAUUSD (Gold)
Recommended timeframe: M15 (entries), with H1 trend filter
Overview
EA XAU Trend Impulse Runner A is an Expert Advisor for trend-following entries on XAUUSD using an H1 EMA trend filter and an M15 impulse candle trigger. The EA includes risk and execution safeguards designed for broker constraints (Stop/Freeze levels and filling modes) and provides trade management features such as break-even handling and optional trailing stop logic.
This product does not use DLLs and does not require external services.
Trading Logic (high level)
The EA checks the following conditions:
-
Trend Direction (H1)
-
Uses EMA(50) and EMA(200) to determine bullish or bearish trend direction.
-
Optionally requires the H1 close to be on the correct side of EMA(50) (parameter: RequirePriceSide).
-
-
Entry Trigger (M15)
-
Detects an impulse candle on the last closed M15 bar:
-
Candle body size must be at least ATR × multiplier.
-
-
Adds an optional entry buffer relative to the previous candle’s high/low to reduce accidental entries.
-
-
Order and Risk Controls
-
Trades are opened only if:
-
Spread is below a maximum (optional spread filter),
-
Daily trade limit is not exceeded,
-
Re-entry cooldown conditions are satisfied,
-
Optional “Master/Portfolio gates” are not blocking trading (global variables).
-
-
Stop Loss and Take Profit
-
Stop Loss (SL): built from a combination of:
-
ATR-based baseline distance, and
-
M15 structure level (recent swing high/low with buffer).
-
A minimum absolute SL distance can be enforced.
-
-
Take Profit (TP):
-
The EA supports a TP based on ATR multiplier.
-
It can also run as a “runner” with TP disabled (TP = 0), relying on management rules.
-
Trade Management
-
Break-even (BE): optional BE movement once price reaches a defined multiple of initial risk (default: BE at 1R), with a configurable BE+ offset.
-
Trailing after BE: optional trailing stop based on M30 candle wick logic with a buffer, applied only after BE conditions are met.
-
Optional Hard Loss Cap (USD): if enabled, the EA can close a position if floating P/L reaches a configured negative USD threshold.
-
Post-Entry Grace Period: a short grace period after entry can be used to avoid unwanted immediate management actions.
Execution and Broker Safety
-
StopLevel/FreezeLevel awareness: SL/TP modifications are checked and adjusted to respect broker minimum distances.
-
Filling mode fallback: attempts supported filling types (IOC/RETURN/FOK depending on broker).
-
Deviation control: configurable slippage/deviation.
-
Designed to operate with one symbol and one magic number per chart.
Portfolio / Master Gates (optional)
If enabled, the EA reads common global variables (e.g., MASTER_RISK_STATUS, MASTER_PORTFOLIO_FULL, MASTER_CLUSTER_METAL_LOCK) and blocks new trades when those gates indicate a lock state. This helps coordinate multiple EAs within a portfolio.
Inputs (main groups)
-
Symbol / Magic / Timeframes
-
Trend filter settings (EMA50/EMA200)
-
Impulse trigger settings (ATR period, impulse multiplier, entry buffer)
-
SL/TP configuration (ATR and structure parameters)
-
Money management (fixed lot or risk-based sizing, lot cap)
-
Trade management (BE, trailing, optional hard loss cap, grace period)
-
Limits (max trades per day, re-entry cooldown)
-
Execution & spread filter
-
Master/portfolio gates
Recommended Setup
-
Attach the EA to XAUUSD M15.
-
Confirm the broker symbol name matches the EA input (e.g., “XAUUSD”).
-
Keep AutoTrading enabled and allow algorithmic trading in terminal settings.
-
Use a stable connection (VPS recommended for uninterrupted operation).
Important Notes
-
Trading involves risk. This product is a tool that executes a defined rule set; it does not provide guarantees of profit.
-
The EA’s behavior depends on broker conditions (spread, execution, symbol specifications) and market volatility.
-
Before using on a live account, test the EA in the Strategy Tester and/or a demo environment with your broker’s settings.
