Get Started
Completed MT4 / MQL4 HFT Scalping Risk Management XAUUSD

High-Frequency Trading EA for Gold
MyGold Pro — MT4 Expert Advisor

A fully automated MetaTrader 4 Expert Advisor engineered for XAUUSD (Gold) scalping. Built in MQL4 with multi-layer risk management, volatility-adaptive entry logic, and HFT-grade execution — delivering precision trades without manual intervention.

HFT
Execution Speed
XAUUSD
Gold Market Focus
M1–M15
Scalping Timeframes
Multi-Layer
Risk Management
  Project Overview

Mr. Kumaran, a professional trader based in Dubai, specialises in gold (XAUUSD) trading and needed a fully automated Expert Advisor capable of executing high-frequency scalping strategies on MetaTrader 4. His existing semi-manual approach limited throughput and exposed positions to emotional decision-making during volatile market sessions.

Vianmax's FinTech team developed MyGold Pro — a bespoke MQL4 EA that combines volatility-adaptive entry triggers, automated lot-size management, and a multi-layer risk engine that includes hard stop-losses, trailing stops, daily drawdown limits, and a kill-switch. The EA is optimised for M1 to M15 timeframes during London and New York sessions when gold liquidity is highest.

  Key Features & Capabilities
High-Frequency Scalping Engine
The EA fires rapid-entry orders on M1/M5/M15 charts using a confluence of micro-trend detection and momentum signals, capturing small pip movements repeatedly across the gold session. Execution latency is minimised through optimised MQL4 order-management logic.
Volatility-Adaptive Entry Logic
Entry conditions dynamically adjust based on ATR (Average True Range) readings, ensuring the EA enters trades during productive volatility windows and pauses during abnormally thin or spiking market conditions — protecting capital during news events.
Multi-Layer Risk Management
A four-tier risk architecture (see Risk Engine section below) including hard stop-loss, trailing stop, dynamic lot sizing based on account equity, and a daily drawdown kill-switch — ensuring capital preservation is the EA's primary objective.
Smart Trend Filter
A higher-timeframe (H1/H4) trend bias filter prevents the EA from taking counter-trend scalps. The EA only opens long positions in bullish bias markets and short positions in bearish bias markets, dramatically improving win-rate consistency.
News & Session Filter
Built-in configurable news blackout windows pause trading before and after high-impact economic events (NFP, FOMC, CPI). Session filters restrict trading to London Open (07:00–10:00 GMT) and New York session (13:00–17:00 GMT) for optimal gold liquidity.
Fully Parametric Configuration
Every EA parameter — lot size mode, risk %, max spread, take-profit/stop-loss pips, max open trades, session windows — is exposed in MT4's Inputs panel for non-technical users to configure without touching code.
Strategy Tester Optimisation
The EA was rigorously back-tested on 5 years of XAUUSD tick data in MT4 Strategy Tester and forward-tested on a demo account for 30 days before live deployment, validating performance across trending, ranging, and volatile gold market conditions.
  Risk Management Engine — 4 Layers

Capital protection is built into every trade through four independent, concurrent risk controls:

Layer 1 — Hard Stop-Loss
Fixed pip-based stop-loss on every order. No trade enters without a defined hard stop. Configurable from 10 to 150 pips depending on timeframe and strategy mode.
Layer 2 — Trailing Stop
Once a position moves into profit by a defined number of pips, a trailing stop locks in gains, following the price movement tick-by-tick to maximise profitable exits.
Layer 3 — Dynamic Lot Sizing
Lot size is computed as a percentage of current account equity on each new order, ensuring consistent risk-per-trade regardless of drawdowns or deposits — preventing over-leveraging after a losing streak.
Layer 4 — Daily Drawdown Kill-Switch
If cumulative daily losses breach a configurable drawdown threshold (e.g. 3% of account equity), the EA automatically closes all open positions and halts trading until the next session — the ultimate circuit-breaker against runaway losses.
  Outcomes & Results
Successful Back-test: 5 Years of XAUUSD Data

Back-tested on 2019–2024 XAUUSD tick data showing consistent profitability across trending and ranging conditions, including COVID-era volatility spikes and 2022/2023 gold bull runs.

30-Day Forward Test Passed on Demo

One-month live-demo forward test validated the EA's entries and risk controls in real market conditions before client handover — confirming no over-fitting to historical data.

Fully Hands-Free Gold Trading

Client transitioned from 4–6 hours/day manual chart monitoring to fully automated execution — freeing time while maintaining disciplined, emotion-free trading aligned with his strategy rules.

Zero Uncontrolled Drawdown Events Post-Deployment

The kill-switch and hard stop-loss layers successfully contained all adverse market moves within pre-agreed risk parameters in live deployment — including during high-impact NFP and FOMC events.

Client Re-engagement for V2 Development

Following successful live performance, Mr. Kumaran engaged Vianmax for a V2 enhancement including machine-learning-based entry signal refinement and multi-symbol capability (XAGUSD, EURUSD).

  Technology Stack
EA Development
MQL4 (MetaQuotes Language 4) MetaTrader 4 Platform MT4 Strategy Tester
Technical Indicators Used
ATR (Average True Range) EMA / SMA Bollinger Bands RSI Momentum MACD
Testing & Optimisation
MT4 Strategy Tester (Tick Data) Dukascopy XAUUSD Historical Data Genetic Algorithm Optimisation
Deployment
Windows VPS (Low-Latency) IC Markets / Pepperstone ECN Broker FIX API Compatible
Client
Mr. Kumaran
Location
Dubai, UAE
Project Type
MT4 Expert Advisor (MQL4)
Instrument
XAUUSD (Gold / USD)
Strategy
High-Frequency Scalping
Timeframes
M1, M5, M15
Status
Completed
Year
2024
Key Highlight
Custom EA with multi-layer risk management & kill-switch
Need a Custom Trading Bot?

MT4, MT5, or Python — Vianmax builds EAs and algo systems tailored to your strategy.

Discuss Your EA
Shape

Automate Your Trading Strategy

From MT4 EAs to full algo platforms — Vianmax delivers reliable, risk-controlled trading automation.

MQL4 Development Gold Trading EA HFT Scalping Risk Management Algo Trading MetaTrader 4