Over the past year I’ve been developing and refining an automated trading system focused on short-term scalping in XAUUSD (Gold). The result of that work is an Expert Advisor called Minting — a deliberately constrained system designed to apply strict, rules-based logic to Gold price action and remove discretionary execution bias.
In this post I want to share the core ideas, design principles, and trade management logic behind Minting, and explain how the system approaches risk control and market structure.
Why Gold Scalping?
Gold (XAUUSD) is a unique instrument: it experiences high liquidity during the London → New York session overlap, it often exhibits clear short-term momentum, and it responds relatively predictably to certain technical structures. Scalping strategies can work well in these conditions — when the rules are precise and the risk controls are strong.
My early manual scalping experiments confirmed that consistent execution and volatility context matter more than raw indicator signals. This observation motivated the transition to automation.
Core Strategy Components
1. EMA-Based Entry Structure
Minting uses simple Exponential Moving Average (EMA) crossovers as the primary directional signal:
-
BUY direction: 5 EMA above 9 EMA
-
SELL direction: 9 EMA below 20 EMA
These structures are evaluated on multiple timeframes to distinguish trending from ranging environments.
2. Volatility and Trend Qualification
Rather than trade every crossover, Minting checks market volatility using the Average True Range (ATR) relative to a threshold. When ATR exceeds the threshold, the EA considers the market to be trending, and EMA structure is weighted more heavily.
In quiet or ranging periods, the EA looks for confirmation across shorter timeframes and additional filters before triggering entries.
3. RSI Range Filter
An RSI range filter is used to avoid entering in strongly overbought or oversold regions where mean reversion behavior often dominates. The RSI must fall within a defined band for eligible entries.
4. Support/Resistance Distance Filtering
Minting evaluates recent local extremes to approximate support/resistance levels and validates that the proposed entry price is sufficiently distant from those levels in USD value. This helps reduce entries that are likely to be rejected by nearby structural levels.
Risk and Trade Management
Equity Usage Control
Each trade’s position size is calculated based on a configurable maximum percentage of account equity. Before opening a trade, the EA estimates margin usage across all open positions to ensure the new trade does not exceed the usage threshold.
Profit-First Trailing Logic
One of the core principles of Minting’s design is profit preservation:
-
Trailing stops activate only after a defined USD profit threshold is reached.
-
Trailing logic tests multiple buffer levels and sets the stop only if it can guarantee a minimum profit if hit.
-
This approach avoids premature stop adjustments that might lock in very small profits while missing larger moves.
Drawdown Awareness
While the main trailing logic protects profits, additional checks monitor adverse movements relative to recent peak profit in pips. If price action weakens against the EMA structure beyond a configured drawdown threshold, the position is exited to lock in gains.
Crossover-Based Exits
Minting also monitors EMA crossovers for exit conditions:
-
BUY positions exit when faster EMAs cross below slower EMAs
-
SELL positions exit when faster EMAs cross above slower EMAs
There is an optional setting that allows SELL crossovers to close positions even if the trade is slightly negative, giving users flexibility in their exit discipline.
Gold-Specific and General Logic
While Minting performs its best on Gold, the code includes generic EMA logic that can run on other symbols. For non-gold instruments it uses a simpler EMA crossover approach combined with the same filtering logic.
The Gold logic includes session restriction (typically London → New York) and tick-value conversions to ensure distance criteria are meaningful in USD terms.
Design Philosophy
Minting was built with three core priorities:
-
Discipline over frequency
Not every signal is a trade — only those that meet multiple contextual checks. -
Execution consistency
Automation removes timing bias and hesitation that can occur in manual trading. -
Capital preservation
Trade sizing, filters, drawdown logic, and trailing targets are all governed by configurable risk parameters.
Because of these design goals, Minting does not use:
-
Martingale
-
Grid systems
-
Hedging
It also places a heavy emphasis on real, USD-based profit tests before adjusting stops.
Testing and Deployment
I recommend testing Minting on a virtual account first to observe its behavior over multiple sessions. Its performance profile can vary depending on spread, broker execution characteristics, and session liquidity.
For those who prefer to monitor before deploying on live accounts, the strategy is best evaluated over at least 1 week of intraday activity and works best when the market is trending and highly volatile, that is the best of days.
Where to Find Minting
Minting is available on the MQL5 Market. You can explore the listing to review full input descriptions, screenshots, and user reviews.
Link to the Market listing: https://www.mql5.com/en/market/product/163355?source=Site+Market+My+Products+Page
Next Steps and Feedback
I’m sharing this blog post as part of ongoing development. If you test Minting and have questions, suggestions, or feedback on logic or controls, feel free to leave a comment here — discussion helps improve the approach over time.


