Gold Mining EA MT5
- Uzmanlar
- Mohamed Baseer Mohamed Sabraj
- Sürüm: 16.0
- Etkinleştirmeler: 10
SJ Gold Mining EA MT5 is a fully automated grid trading expert advisor optimized for XAUUSD (Gold) on M15, built with a suite of intelligent drawdown control and risk management systems that go well beyond a standard grid.
KEY FEATURES
Entry signals are generated by a built-in new own indicator combined with an RSI confirmation filter. A trade is only opened when both indicators agree, dramatically reducing false entries.
2· Entry Filter StackThree independent filters gate every new signal before any trade is opened:
- EMA Filter — Price must be on the correct side of both a fast and slow EMA (configurable periods and timeframe). Separate pass/fail per direction keeps BUY and SELL independent.
- ADX Filter — ADX must exceed a minimum level (ADX_MinLevel) to confirm trend strength. Prevents entries in flat, ranging conditions.
- S/R Filter — Requires price to be within a pip buffer of a recent H1 or D1 support/resistance level. Ideal for mean-reversion setups near key levels.
- Auto-expanding grid adds positions as price moves against the initial trade, averaging down (BUY) or up (SELL) at configurable distance intervals.
- MaxOpenTrades hard cap prevents runaway exposure.
- Emergency profit close — exits the full grid at a minimum dollar target when all levels are filled.
This is the EA's most advanced protection system. When a grid is in drawdown and the entry indicators flip to confirm the opposite direction, the EA activates a 3-stage response:
- Grid Freeze — stops adding new grid orders into a confirmed counter-trend move
- Progressive Target Reduction — automatically lowers the profit target as drawdown deepens:
- Stage 1 (default DD > 1%): target reduced to 75%
- Stage 2 (default DD > 2%): target reduced to 50%
- Stage 3 (default DD > 3%): accept breakeven / near-zero exit
- Hard Exit — if floating loss reaches a configurable threshold (default 2.5%) while trend is reversed, all positions are closed immediately to cap the drawdown
- Confirmation Bars — reversal signal must persist for 1–5 bars before any action fires, eliminating noise-triggered exits
- Auto Lot scales linearly with account balance: (Balance / BaseCapital) × 0.01 lots. As balance grows, lot size grows proportionally.
- Risk % Lot: alternatively size each trade by fixed risk percentage with ATR-based SL distance.
- Margin guard: lot size is automatically capped if free margin is insufficient, preventing margin calls.
- Scaled profit targets: CloseMultipleOrders and CloseSingleOrder targets scale proportionally with the base lot size — targets always match actual risk.
- SL_FIXED mode: fixed pip distance, fully user-defined.
- SL_ATR mode: stop loss is calculated as ATR(period) × multiplier and recalculated on every new bar, automatically widening during high-volatility sessions (news, open) and tightening during calm periods.
- Both modes apply to individual positions and to the grid average SL simultaneously.
A unique two-phase trailing system operates independently for grid mode and single-position mode:
8· Multi-Layer Drawdown Protection
Three independent safeguards protect the account at different time horizons:
| Layer | Parameter | Action |
|---|---|---|
| Cut Loss | Float loss % of starting balance | Force-close all positions immediately |
| Max Session DD | Equity drawdown % from session start | Close all + halt new trades |
| Daily Loss Limit | Equity drop % from daily open | Block new entries (optionally close all) |
All three reset automatically at the start of a new trading day.
9. Economic News FilterConnects to a live news feed (ForexFactory calendar via nfs.faireconomy.media ) and automatically:
- Blocks new trades X minutes before high-impact events
- Optionally closes all trades at breakeven before news
- Resumes trading Y minutes after the event passes
- Filterable by impact level (High / Medium / Low) and keyword (NFP, CPI, FOMC, etc.)
- Draws vertical news lines on the chart for visual reference
- Set your trading window in local time — the EA converts automatically to broker time using auto-detected or manual GMT offset
- Stops new trades before the Friday market close (configurable time)
- Optionally closes all open positions at Friday close
| Parameter | Value | |
|---|---|---|
| Symbol | XAUUSD (Gold) | |
| Timeframe | M15 | |
| Minimum Capital | $500 per 0.01 base lot | |
| Magic Number | 6228 (unique per chart) |
minimum Leverage 1:100
Backtesting:
Simply run on XAUUSD m15 Timeframe using default settings with your Broker BacktestGMTOffset

