Gold Momentum Lock EA
- Experts
-
Joshy Antony
Professional Gold trader and MQL5 developer specializing in automated trading systems for XAUUSD.
Developed Matrix Gold Pro EA — a multi-strategy system with 12 trading strategies, smart risk management, and Telegram alerts. Trading Gold since 2013. - Versão: 1.14
Gold Momentum Lock EA
A momentum-based Expert Advisor for XAUUSD with an automatic profit-locking system and an on-chart control panel. It is designed to join short bursts of directional movement and then protect open profit progressively, rather than to trade as often as possible.
How it works
The EA watches for a run of consecutive candles in one direction. When a configurable number of rising candles form in a row, it looks to go long; a run of declining candles sets up a short. An optional EMA trend filter restricts entries to the direction of the larger trend, so the EA joins moves rather than fading them.
Once a trade reaches a defined profit measured in multiples of the initial risk, the EA automatically closes a configurable portion of the position to bank realised profit, and moves the stop to just beyond the entry price so the remainder can no longer turn into a loss. The remaining portion then trails behind price by an ATR-based distance, with a fixed take-profit acting as a final target.
Risk management
Position size is calculated automatically from a fixed percentage of account equity and the stop distance, so the lot scales with the account and is never a fixed oversized lot. Stops and targets are based on Average True Range, so they adapt to current volatility. A daily loss limit halts new trades for the rest of the day once a set percentage of equity is lost. A spread filter skips entries when the spread is too wide, and a maximum-positions setting prevents stacking trades. Before every entry the EA also verifies that the account has enough free margin for the calculated lot, scaling down or skipping when it does not.
Dashboard panel
An on-chart panel shows live status at a glance, including active, paused or daily-halt state, trend direction, the current candle run, spread, ATR, balance, equity, the day's profit or loss, remaining daily-loss room, and the open position with its current profit and lock status. Two buttons let the user pause and resume new entries while open trades continue to be managed, and close all of the EA's positions manually.
Recommended use
The intended symbol is XAUUSD, and the recommended timeframe range is M15 to H1, although users should test on their own broker's data to determine what fits best. Algo Trading must be enabled in the terminal and in the EA's Common tab for the panel buttons to respond. Testing should be done in the Strategy Tester using real-tick modelling with commission and realistic spread, followed by a period of demo forward-testing before any live use, since results vary between brokers due to differences in gold spreads.
Inputs
The EA exposes inputs for risk percentage, daily loss limit, maximum positions, ATR stop multiplier, final reward-to-risk target, candle-run length, trend filter toggle and EMA period, profit-lock trigger, partial-close percentage, breakeven buffer, trailing settings, ATR period, magic number, and maximum allowed spread. All entry, exit, and risk behaviour is adjustable from inputs without editing code.
Important notes
This Expert Advisor is a trading tool. It is not financial advice and does not guarantee profit. Trading carries risk, and leveraged trading of gold can lose money rapidly. Past performance and Strategy Tester results do not predict future results. Use only capital you can afford to lose, and validate the settings on your own account conditions before committing real funds.
