Trading strategy Logic and function tested

GDI Breakout Scalper EA

An M1 scalper for gold: a Donchian channel breakout with a volatility expansion filter and H1 trend context.

  • Version2.00
  • Last updated2026-12-05
  • SymbolGold (XAUUSD) only
  • TimeframeM1 chart

Download GDI_Breakout_Scalper_EA.ex5 ↓ Settings file (.set) ↓ Get a GDI Key (7-day free trial) →

Status. The logic and the operation of this EA have been tested. Backtests are in progress and will be published on each EA's page. Backtesting is the user's own responsibility: whoever pays for the key may use and test every product.

What it is

A short-term breakout system tuned for a typical gold spread around 18 to 20 points. A break of the 20-bar Donchian channel counts only when volatility is expanding and the H1 trend agrees.

The three operating modes

ModeWhat the EA does
Alert only (default)Never opens a position. Each entry signal raises an alert (once per bar and direction) in the Experts tab, as a pop-up and, if you switch it on, as a phone notification. Positions opened earlier by the EA keep their server stop and the EA may still close them.
Auto trading standardAt most one position or pending order of this EA at a time, and never more than one entry in the same trading session. The strategy's own stop, target and trade management apply.
Auto trading light gridThe first entry follows the standard rules. The EA may then add layers at a fixed distance, with the same lot and in the same direction, up to the maximum number of layers, under one common stop, one basket target and a maximum basket loss.

The selector is the first input in the window (InpOperatingMode). There is no martingale in any mode (the lot is never increased after a loss) and no hedging (the EA never opens against an open gold position or order on the account). Where the strategy text allows several trades a day or several open positions, the operating mode is the stricter rule and wins.

The strategy: how it decides

Who it suits

Scalpers who want an M1 breakout with strict spread and volatility rules.

Who it does not suit

Accounts with wide spreads: the 40-point cap will block most entries.

What happens behind the scenes

  1. On start the EA checks that the chart is gold (XAUUSD with any broker suffix, or GOLD); on any other symbol it stops with a message and does not trade.
  2. It verifies the GDI Key with sync.golddailyinsights.com when it starts and again periodically. Without a valid key it sends no order and no signal alert. A lapsed key never closes positions that are already open.
  3. The strategy evaluates its signal and its own filters. Every order, market or pending, then passes through one common gate, which checks in turn: gold and chart symbol, licence, operating mode, magic number, real-account confirmation, one order at a time, one entry per session, grid pause, no opposite gold position, and the lot ceiling and broker lot step.
  4. If the gate refuses, nothing is sent and the reason is written in the Experts tab.
  5. The session already used is kept in memory, in a terminal global variable named GDIS_account_magic and in the deal history.
  6. In light grid mode the common stop, basket target, basket loss limit and new layers are managed on every tick, so the terminal must stay open and connected. The common stop is also on the server.

Trading sessions and the one-entry rule

Sessions follow your broker's server time. The defaults suit brokers on GMT+2 or GMT+3 and can be changed with InpSessLondonHour and InpSessNewYorkHour.

SessionServer time (default)
Asia00:00 to 10:00
London10:00 to 15:00
New York15:00 to 24:00

In both automatic modes there is at most one new entry per session, even if the first trade has already closed. The EA checks its memory and the account's deal history, so restarting the terminal does not reset the count. If the history cannot be read, it does not open.

The light grid in detail

Worked example of the distances (not a forecast)

A buy of 0.01 lots at 4,000.00 with the defaults: layers can be added at 3,992.00 and 3,984.00, and the common stop sits at 3,976.00. With a 100-ounce contract, the three layers stopped there would lose about 24 + 16 + 8 = 48 USD, before spread, swap and slippage. If the 2 per cent basket limit is smaller than that on your balance, the basket is closed earlier. With only the first order open, the target is 4,006.00; with two layers the average is 3,996.00 and the target 4,002.00.

A light grid increases the amount at risk while price moves against you. Gaps and slippage can make a loss larger than the figures above.

Requirements

RequirementDetail
PlatformMetaTrader 5 (.ex5 file; MetaTrader 4 is not supported).
SymbolXAUUSD with any broker suffix, or GOLD.
TimeframeM1 chart
Account typeHedging account for the light grid. Alert only and standard also run on netting accounts.
GDI KeyRequired. The file itself is free to download.
Terminal settingsTools > Options > Expert Advisors: tick 'Allow WebRequest for listed URL' and add https://sync.golddailyinsights.com. For the automatic modes, allow Algo Trading.
ComputerThe terminal must stay open and connected while the EA works; a VPS is the usual choice.

Download and licence

You receive the compiled file only: GDI_Breakout_Scalper_EA.ex5, with a settings file holding every input at its default and an empty key. The EA works only with a valid GDI Key typed into InpGdiKey.

Compiled with MetaEditor: 0 errors, 0 warnings. SHA-256 of the .ex5 file: d57066cf8589cfe09172c7ed0f3039338f05d414e2a7cfa2ed437b7f0f3a4110.

How the key works: GDI Key and licence check.

Installation and first run

  1. Copy the .ex5 file into MQL5/Experts in your MetaTrader 5 data folder (File > Open Data Folder) and refresh the Navigator.
  2. In Tools > Options > Expert Advisors, tick 'Allow WebRequest for listed URL' and add https://sync.golddailyinsights.com.
  3. Open an XAUUSD chart and drag the EA onto it. On the Inputs tab press Load and choose the .set file.
  4. Paste your GDI Key into InpGdiKey. Leave InpOperatingMode on Alert only for the first sessions.
  5. Check the Experts tab: the licence is confirmed and the operating mode is shown.
  6. When you choose an automatic mode, start with the smallest lot, preferably on a demo account, and tick the Common tab option 'Allow Algo Trading'. A real account also needs InpModeAllowReal set to true.

Running your own backtest

Open the Strategy Tester (Ctrl+R), choose the EA, an XAUUSD symbol and a period, load the settings file and select the operating mode you want to study. The key is not checked in the tester. The economic calendar and push notifications do not work inside the tester, so news filters behave differently there. Backtests are in progress and will be published on each EA's page. Backtesting is the user's own responsibility: whoever pays for the key may use and test every product.

Inputs: the complete manual (56 inputs)

Listed in the order of the MetaTrader inputs window. Distances marked 'points' are broker points unless the text says otherwise.

Operating mode

InputDefaultWhat it does and how to use it
InpOperatingMode1) ALERT ONLY: opens no order, only sends alertsOperating mode. Choose this first. Alert only is the safe start. Options: 1) ALERT ONLY: opens no order, only sends alerts; 2) AUTO TRADING STANDARD: one order, one entry per session; 3) AUTO TRADING LIGHT GRID: capped layers, same lot.
InpModeAllowRealfalseI confirm this is a real account I want to trade. Leave false until you really intend to trade a real account.
InpModeMaxLot0.10Lot ceiling for any single order. A safety ceiling: a larger lot is reduced to this value.
InpModeAlertPopuptrueAlert only mode: pop-up alert. Affects messages only.
InpModeAlertPushfalseAlert only mode: push notification to the phone. Affects messages only.

Trading sessions (broker server time)

InputDefaultWhat it does and how to use it
InpSessLondonHour10London session starts (server hour); Asia runs from 00:00. Adjust to your broker's server clock.
InpSessNewYorkHour15New York session starts (server hour), runs to 24:00. Adjust to your broker's server clock.

Light grid (used only in mode 3). 100 points = 1.00 USD

InputDefaultWhat it does and how to use it
InpLgStepPoints800Fixed distance between layers (points). Only read in the light grid mode.
InpLgMaxLevels3Maximum layers, first order included (2 to 5). Only read in the light grid mode.
InpLgTargetPoints600Basket target from the average price (points). Only read in the light grid mode.
InpLgStopPoints800Common stop: this far beyond the last layer (points). Only read in the light grid mode.
InpLgMaxLossPct2.0Basket maximum loss, % of balance (closes all layers). Only read in the light grid mode.
InpLgMinMinutes15Minimum minutes between layers. Only read in the light grid mode.
InpLgTrendBlocktrueNo new layer against a strong trend. Only read in the light grid mode.
InpLgTrendTfH1Strong-trend filter: timeframe. Only read in the light grid mode.
InpLgTrendAdxPer14Strong-trend filter: ADX period. Only read in the light grid mode.
InpLgTrendAdx25.0Strong-trend filter: ADX at or above this is strong. Only read in the light grid mode.
InpLgPauseHours24Pause after a basket is stopped out (hours). Only read in the light grid mode.

GDI Key

InputDefaultWhat it does and how to use it
InpGdiKeyempty: paste your keyGDI Key. Paste your personal key here; the EA sends no order and no alert without a valid key.

Identification

InputDefaultWhat it does and how to use it
InpMagicNumber20260914Magic number that identifies this EA's orders. Keep it unique for each copy of an EA on the same account; do not change it while the EA has open positions.
InpTradeCommentGDIBrkOrder comment.

Breakout (Donchian channel)

InputDefaultWhat it does and how to use it
InpDonchianPeriod20M1 bars used for the channel (highest/lowest). Counted in bars. Shorter reacts faster and gives more false signals; longer is slower and steadier.
InpBreakoutBufferATR0.15Minimum breakout buffer (x ATR) - filters out weak breakouts.

Volatility filter (avoids dead/ranging market)

InputDefaultWhat it does and how to use it
InpATRPeriod14ATR period used for stop and target. Counted in bars. Shorter reacts faster and gives more false signals; longer is slower and steadier.
InpATRAvgPeriod50Lookback for the ATR average (expansion check). Counted in bars. Shorter reacts faster and gives more false signals; longer is slower and steadier.
InpMinATRExpansion1.10Current ATR must be >= average x this factor.

Trend filter (H1 context)

InputDefaultWhat it does and how to use it
InpUseH1TrendFiltertrueUse the H1 trend filter?. true switches it on, false switches it off.
InpH1EMAPeriod50H1 EMA period. Counted in bars. Shorter reacts faster and gives more false signals; longer is slower and steadier.

Momentum confirmation

InputDefaultWhat it does and how to use it
InpUseRSIFiltertrueUse the RSI filter?. true switches it on, false switches it off.
InpRSIPeriod9RSI period. Counted in bars. Shorter reacts faster and gives more false signals; longer is slower and steadier.
InpRSIMin48.0Minimum RSI for a buy (mirrored for a sell).
InpRSIMax85.0Maximum RSI for a buy (mirrored for a sell).

Risk management (ATR-based, scaled to the symbol)

InputDefaultWhat it does and how to use it
InpUseFixedLottrueUse a fixed lot size? (false = risk %). Start with 0.01. On a standard gold contract, 0.01 lots gain or lose about 1 USD for each 1.00 USD move.
InpFixedLot0.01Fixed lot size. Start with 0.01. On a standard gold contract, 0.01 lots gain or lose about 1 USD for each 1.00 USD move.
InpRiskPercent0.5Risk % per trade (if not using a fixed lot). A smaller number means a smaller position for the same stop distance.
InpSL_ATR_Mult1.4Stop loss = ATR x this multiplier. A larger multiple gives the trade more room and a larger loss when the stop is hit.
InpTP_RR_Ratio1.5Take profit = stop loss x this risk:reward ratio.
InpMinSLPoints120Minimum stop loss, in points (safety floor). In broker points.
InpMaxSLPoints450Maximum stop loss, in points (safety ceiling). In broker points.
InpUseBreakEventrueMove stop to break-even?. Moves the stop to the entry area once the trade is in profit. Ignored while the light grid is active.
InpBreakEvenATRMult0.8Trigger break-even once profit >= ATR x this. Moves the stop to the entry area once the trade is in profit. Ignored while the light grid is active.
InpBreakEvenLockPts15Points of profit locked in at break-even. Moves the stop to the entry area once the trade is in profit. Ignored while the light grid is active.
InpUseTrailingStoptrueUse a trailing stop?. Trailing locks in part of a move but can close a trade early. Ignored while the light grid is active.
InpTrailingStartATR1.0Start trailing once profit >= ATR x this. Trailing locks in part of a move but can close a trade early. Ignored while the light grid is active.
InpTrailingStepATR0.5Trailing distance (x ATR). Trailing locks in part of a move but can close a trade early. Ignored while the light grid is active.

Operational filters (news / spread / session)

InputDefaultWhat it does and how to use it
InpMaxTradesPerDay25Maximum trades per day.
InpMaxDailyLossPercent3.0Stop trading once daily loss reaches this % of balance. A protective limit; check it against your balance.
InpMaxSpreadPoints40Largest spread, in broker points, at which a new order is allowed. Raise it if your broker's gold spread is normally wider; lower it to be stricter.
InpUseSessionFiltertrueApply the strategy's trading hours. Hours follow the broker's server time.
InpSessionStartHour9Strategy trading hours: start (server time). Hours follow the broker's server time.
InpSessionEndHour19Strategy trading hours: end (server time). Hours follow the broker's server time.
InpUseNewsBlackouttrueBlock a typical high-impact news window (e.g. NFP/CPI/FOMC). Uses the MetaTrader economic calendar, which is not available inside the Strategy Tester.
InpNewsHour115News blackout hour (server time - align to 13:30 UTC). Uses the MetaTrader economic calendar, which is not available inside the Strategy Tester.
InpNewsMinuteStart125Blackout start minute. Uses the MetaTrader economic calendar, which is not available inside the Strategy Tester.
InpNewsMinuteEnd145Blackout end minute. Uses the MetaTrader economic calendar, which is not available inside the Strategy Tester.
InpCooldownSeconds20Minimum wait between trades (seconds).

Messages and troubleshooting

Message in the Experts tabWhat it means
licence: ...The key is missing, expired, in use on another IP, or the server address is not allowed in the terminal options.
this is a real account and 'I confirm this is a real account' is not tickedSet InpModeAllowReal to true only if you really want to trade that account.
one order at a timeThe EA already has a position or pending order.
one entry per session: already usedWait for the next session.
light grid pause after a stopped basketThe pause set in InpLgPauseHours is running.
a message about an opposite gold position or orderSomething on the account is open in the other direction; the EA will not hedge it.
the lot is below the broker minimumRaise InpModeMaxLot or the lot input to at least your broker's minimum.

Risks

Frequently asked questions

Which symbol does it trade?
Gold only: XAUUSD with any broker suffix, or GOLD. On any other symbol it does not trade.
Does it open orders as soon as I attach it?
No. The default mode is Alert only. Orders are sent only after you choose one of the two automatic modes, and on a real account only after you also tick the real-account confirmation.
Does it use martingale or hedging?
No. The lot is never increased after a loss and the EA never opens against an open gold position or order on the account.
Why did it not enter on a second signal?
In the automatic modes there is at most one entry per trading session and one order at a time.
Do I need a GDI Key?
Yes. The file is free to download and works only with a valid GDI Key. In the MetaTrader Strategy Tester the key is not checked.
Is the source code available?
No. You receive the compiled .ex5 file and a settings file.
Are there backtest results?
Backtests are in progress and will be published on each EA's page. Backtesting is the user's own responsibility: whoever pays for the key may use and test every product.
Is profit guaranteed?
No. Trading carries a high level of risk and an EA can lose money.

Trading carries risk. An EA can lose money, and nothing here is advice. Risk disclosure

Related EAs

Next steps

GDI Key and plans Getting started Ask a question All GDI EAs

Version 2.00, last updated 2026-12-05.