AQUILA GOLD EA - HOW TO SET UP

AQUILA GOLD EA - HOW TO SET UP

15 April 2026, 10:37
Kestutis Balciunas
0
20
AQUILA GOLD EA - HOW TO SET UP

INFO

Working Specifications:

  • Symbols: XAUUSD, GOLD (gold instruments only)
  • Timeframe: H1 (1-hour)
  • Minimum Deposit: $1,000 recommended ($5,000+ for deeper martingale levels)
  • Leverage: 1:100 or higher recommended
  • Account Type: Any (Hedging account preferred for MT5)
  • Broker: ECN broker with tight gold spreads recommended
  • VPS: Highly recommended for uninterrupted 24/5 operation

Core Features:

  • Dual SMA channel breakout entries (SMA High + SMA Low) with configurable breakout distance
  • Optional RSI momentum filter to block entries in overbought/oversold conditions
  • Progressive martingale recovery with up to 10 levels and exponential lot scaling
  • 7 individually configurable grid correction distance tiers
  • Weighted-average take profit for martingale series closing
  • Live News Filter with economic calendar integration
  • Risk safeguards: Max Drawdown, Daily Loss limit, Max Orders, Max Lot, Spread filter
  • Interactive on-chart dashboard with 5 one-click control buttons

STEP 1 - INSTALLATION

For MT5:

  1. Purchase Aquila Gold EA from the MQL5 Market
  2. The EA installs automatically into your MetaTrader 5 terminal
  3. Open the Navigator panel (Ctrl+N)
  4. Find "Aquila Gold EA" under Expert Advisors > Market
  5. Drag it onto an XAUUSD H1 chart

For MT4:

  1. Purchase Aquila Gold EA from the MQL5 Market
  2. The EA installs automatically into your MetaTrader 4 terminal
  3. Open the Navigator panel (Ctrl+N)
  4. Find "Aquila Gold EA" under Expert Advisors > Market
  5. Drag it onto an XAUUSD H1 chart

Important: Enable WebRequest for News Filter

The News Filter requires internet access to fetch the economic calendar.

MT4: Go to Tools > Options > Expert Advisors > Check "Allow WebRequest for listed URL" and add:

https://nfs.faireconomy.media

MT5: Go to Tools > Options > Expert Advisors > Check "Allow WebRequest for listed URL" and add:

https://nfs.faireconomy.media

Also make sure "Allow algorithmic trading" is enabled.


STEP 2 - ENTRY LOGIC (MA BREAKOUT + RSI)

Aquila Gold EA enters trades when price breaks out of a dual SMA channel, optionally confirmed by RSI. Both conditions must be met simultaneously on a closed bar.

SMA Channel Breakout

The EA maintains two simple moving averages on the configured timeframe:

Parameter Default Description
InpMA_Period_High 14 SMA period applied to High prices
InpMA_Period_Low 14 SMA period applied to Low prices
InpMA_TF H1 Timeframe for MA calculation
InpBreakoutDistance 100 Breakout distance in points
  • BUY: Close price breaks above  SMA(High) + BreakoutDistance
  • SELL: Close price breaks below  SMA(Low) - BreakoutDistance

The EA uses confirmed (closed) bar data to prevent false signals and requires a fresh breakout from a prior non-breakout state to avoid re-entry into existing moves.

RSI Momentum Filter

Parameter Default Description
InpUseRSI true Enable/disable RSI filter
InpRSI_Period 14 RSI calculation period
InpRSI_Overbought 70 Blocks BUY entries when RSI above this level
InpRSI_Oversold 30 Blocks SELL entries when RSI below this level

Set  InpUseRSI = false  to trade pure breakouts without RSI confirmation (not recommended - increases false signal rate).


STEP 3 - MARTINGALE RECOVERY

When a trade moves against the position, the EA opens additional orders at progressively wider distances to average down the entry price. The full series is closed on weighted-average take profit.

Core Martingale Settings

Parameter Default Description
InpUseMartingale true Enable martingale recovery
InpLotMultiplier 2.0 Lot multiplier per recovery level
InpMaxMartLevels 10 Maximum recovery levels per series
InpMaxLots 100.0 Hard cap on per-order lot size

Lot Progression Example (InpInitialLots = 0.01, InpLotMultiplier = 2.0)

Level Calculation Lot Size
1 (initial) 0.01 × 2^0 0.01
2 0.01 × 2^1 0.02
3 0.01 × 2^2 0.04
4 0.01 × 2^3 0.08
5 0.01 × 2^4 0.16
6 0.01 × 2^5 0.32
7 0.01 × 2^6 0.64
8 0.01 × 2^7 1.28
9 0.01 × 2^8 2.56
10 0.01 × 2^9 5.12

All lots are rounded to broker's lot step and capped by  InpMaxLots .

Conservative alternative: Set  InpLotMultiplier = 1.5  for a gentler progression - level 10 becomes 0.38 lot instead of 5.12 lot.


STEP 4 - GRID DISTANCE TIERS

Unlike fixed-distance grids, Aquila Gold uses 7 individually configurable distance tiers. Each martingale correction can be placed at a different distance from the previous entry, letting you widen the grid progressively to slow capital commitment during deep drawdowns.

Parameter Default Description
InpCorrDist1 100 Distance to level 1 correction (points)
InpCorrDist2 200 Distance to level 2 correction (points)
InpCorrDist3 300 Distance to level 3 correction (points)
InpCorrDist4 400 Distance to level 4 correction (points)
InpCorrDist5 500 Distance to level 5 correction (points)
InpCorrDist6 600 Distance to level 6 correction (points)
InpCorrDist7 700 Distance to level 7 correction (points)

How It Works

After the initial order opens, the EA waits for price to move against it by  InpCorrDist1  points, then opens the level 1 correction. After level 1, it waits another  InpCorrDist2  points for level 2, and so on.

Default grid footprint (from initial entry):

Correction Level Cumulative Distance
Level 1 100 pts
Level 2 300 pts
Level 3 600 pts
Level 4 1000 pts
Level 5 1500 pts
Level 6 2100 pts
Level 7 2800 pts

Tuning for volatility: Widen all distances proportionally for high-volatility conditions (e.g., double them during NFP week). Narrow them for ranging markets. The widening pattern (each level larger than the previous) is the key design principle - keep it monotonic.

Note: Corrections beyond level 7 (levels 8-10) reuse  InpCorrDist7  as the spacing.


STEP 5 - TAKE PROFIT (WEIGHTED AVERAGE)

Aquila Gold uses two take profit modes that operate at different points in the cycle.

Single-Order TP

Parameter Default Description
InpTakeProfit 100 Take profit in points (applied to the initial order when no grid is active)

When only the initial order is open (no corrections), the EA targets this fixed distance from the entry price.

Weighted-Average Martingale TP

Parameter Default Description
InpMartingaleTP 10 Martingale TP distance from the weighted average entry price (points)

Once a martingale series is active (one or more corrections added), the EA calculates the volume-weighted average entry price across all orders in the series, then closes the entire series when price reaches  weighted average + InpMartingaleTP  (buy) or  weighted average - InpMartingaleTP  (sell).

Why this is efficient: As lot sizes grow exponentially through the martingale levels, the weighted average shifts heavily toward the most recent (largest) orders. A small retracement from the deepest correction is enough to close the whole series in profit - no need for price to reverse to the original entry level.


STEP 6 - RISK MANAGEMENT

Parameter Default Description
InpMaxDDPercent 50.0 Max equity drawdown % before emergency close (0 = disabled)
InpDailyLossPercent 0.0 Max daily loss % before trading stops (0 = disabled)
InpCloseOnDD true Close all positions when Max DD is hit
InpMaxOrders 20 Hard cap on total open orders (buy + sell)
InpMaxSpread 50 Blocks new entries when spread exceeds this (points)
Profile Max DD Daily Loss Max Orders Lot Multiplier
Conservative 30% 5% 10 1.5
Balanced (default) 50% 0% (disabled) 20 2.0
Aggressive 70% 0% 20 2.0

Important: Setting  InpMaxDDPercent = 0  disables the drawdown safeguard entirely. Always set a non-zero value on live accounts.


STEP 7 - TIME FILTER

Optional hour-based trading window to restrict entries to specific sessions.

Parameter Default Description
InpUseTimeFilter false Enable hour-based trading window
InpStartHour 2 Trading start hour (server time, 0-23)
InpEndHour 22 Trading end hour (server time, 0-23)

When enabled, the EA only opens new initial entries within the window. Existing martingale series continue to manage corrections and exits regardless of the hour - the filter only affects fresh cycle starts.

Use case: Avoid Asian session liquidity lows on gold by setting Start = 7 and End = 21 (server time).


STEP 8 - NEWS FILTER CONFIGURATION

Activation

Set InpUseNewsFilter = true to enable live economic calendar filtering.

How It Works

  1. The EA fetches the weekly economic calendar from the FairEconomy API every few hours
  2. It filters events by currency and impact level
  3. Trading pauses before and resumes after each matching event
  4. If the API is unavailable, a built-in fallback detects major events (NFP, FOMC, CPI, GDP, ECB Rate)

Timing

Parameter Default Description
InpNewsBeforeMins 50 Stop trading X minutes before event
InpNewsAfterMins 30 Resume trading X minutes after event
InpNewsCurrencies "USD" Comma-separated currencies to filter (e.g., "USD,EUR,GBP")

Impact Levels

Parameter Default Description
InpHighImpact true Filter high-impact events (NFP, FOMC, CPI)
InpMedImpact false Filter medium-impact events
InpLowImpact false Filter low-impact events

News Display on Chart

Parameter Default Description
InpShowNewsLines true Show vertical lines at event times
InpShowNewsText true Show event name text labels
InpNewsDisplayCount 5 Number of upcoming events to display
InpClrHighNews clrRed High impact line/text color
InpClrMedNews clrOrange Medium impact line/text color
InpClrLowNews clrYellow Low impact line/text color

WebRequest Setup (REQUIRED)

You MUST add the news URL to your platform's allowed list:

MT4/MT5: Tools > Options > Expert Advisors > Allow WebRequest for listed URL > Add:

https://nfs.faireconomy.media

Without this step, the news filter will use only the built-in fallback calendar covering NFP, FOMC, CPI, GDP, and ECB Rate decisions.

Gold-specific note: Because XAUUSD is highly sensitive to USD-denominated news, the default currency filter is  USD . Add other currencies only if you want wider pauses.


STEP 9 - GENERAL SETTINGS

Parameter Default Description
InpInitialLots 0.01 Initial lot size for the first order in a cycle
InpTakeProfit 100 Fixed TP for the initial order (points)
InpMartingaleTP 10 Martingale series TP from weighted average (points)
InpMaxSpread 50 Max spread filter (points)
InpMaxOrders 20 Hard cap on total open orders
InpMagicNumber 20250407 Unique EA identifier for order management
InpEAComment "AquilaGold" Comment text attached to all orders

Important: If running multiple instances of Aquila Gold on the same account (e.g., one on XAUUSD and one on GOLD.m), each instance MUST have a unique Magic Number to prevent order conflicts.


DASHBOARD

Once running, the EA displays a real-time info panel on your chart showing:

  • Symbol, timeframe, current spread, server time
  • Account balance, equity, free margin, floating P/L
  • Buy series: order count, weighted average entry, current drawdown
  • Sell series: order count, weighted average entry, current drawdown
  • Current signal readings: SMA(High), SMA(Low), RSI
  • News filter status and countdown to next filtered event
  • Trade ON/OFF status

Interactive Control Buttons

The panel includes 5 clickable buttons for one-click order management:

Button Action
Trade ON / Trade OFF Toggles new entries on/off. Existing positions continue to be managed.
Close All Immediately closes every position managed by this EA instance (by Magic Number).
Close Buy Closes all buy positions (entire buy series).
Close Sell Closes all sell positions (entire sell series).
Del Pending Deletes all pending orders for this EA instance.

Panel Customization

Parameter Default Description
InpDrawPanel true Enable/disable panel display
InpPanelX 10 Panel X position (pixels from top-left)
InpPanelY 25 Panel Y position (pixels from top-left)
InpPanelBgColor dark navy Panel background color
InpPanelBorderColor dark gray Panel border color
InpPanelTextColor light gray Panel text color
InpPanelHeaderColor sky blue Panel header color
InpFont Consolas Panel font name
InpFontSize 9 Panel font size

Set  InpDrawPanel = false  to hide the panel (reduces CPU usage on VPS).


If you are new to Aquila Gold EA, use these conservative settings:

  1. InpInitialLots = 0.01 (start small - martingale grows quickly)
  2. InpLotMultiplier = 1.5 (gentler than the default 2.0)
  3. InpMaxMartLevels = 5 (cap grid depth until you understand the behavior)
  4. InpMaxDDPercent = 30.0 (tight drawdown safety net)
  5. InpUseRSI = true (keep the RSI filter on - reduces false signals)
  6. InpUseNewsFilter = true (essential for gold on high-impact USD events)
  7. Start on Demo (test for at least 2-4 weeks before going live)

IMPORTANT NOTES

  1. Gold only: Aquila Gold is designed exclusively for XAUUSD / GOLD. Do not run it on forex pairs - the breakout distance, grid tiers, and TP distances are all calibrated for gold's point value and volatility.

  2. H1 timeframe: The EA is designed for H1. Running it on lower timeframes will produce far more signals and dramatically change the risk profile - not recommended without re-tuning every parameter.

  3. Martingale Risk: Grid recovery with martingale increases exposure exponentially. At default settings (2.0x multiplier, 10 levels), level 10 is 512x the initial lot size. Always test on demo first and use  InpMaxLots  +  InpMaxMartLevels  +  InpMaxDDPercent  to cap risk.

  4. Hedging vs Netting (MT5): On MT5 netting accounts, only one direction can be open at a time - the EA will only manage one series per cycle. Hedging accounts are preferred.

  5. Broker: Choose an ECN broker with tight gold spreads (under 50 points). Wide spreads will trigger the MaxSpread filter and prevent trading, and will eat into the small Martingale TP distance.

  6. VPS: For best results, run on a VPS located close to your broker's server. H1 operation tolerates brief disconnections better than M1 scalpers, but grid management requires the EA to be running when corrections trigger.

  7. WebRequest: The news filter REQUIRES the WebRequest URL to be added in platform settings. Without it, only the pattern-based fallback works (NFP, FOMC, CPI, GDP, ECB only).

  8. Unique Magic Numbers: Multiple Aquila Gold instances on the same account (e.g., XAUUSD + GOLD.m symbols) must each have a unique  InpMagicNumber  to prevent order conflicts.


CONTACT & SUPPORT