Account protection Released Used by the author I use this one myself, every day.

GDI Equity Management EA

Gold only. Locks in profit with a trailing lock and a profit target on your floating profit. Alert only by default; it never opens a trade.

  • Version4.02
  • Last updated2026-12-02
  • SymbolGold only: XAUUSD (any broker suffix) or GOLD
  • TimeframeAny chart; the timeframe does not matter

Download GDI_Equity_Management_EA.ex5 ↓ Download the .set file ↓ Download the ZIP ↓ Get a GDI Key (7-day free trial) →

Read this first. Gold (XAUUSD) is quoted as a CFD by most brokers. CFDs are complex instruments and carry a high risk of losing money quickly because of leverage. Most retail accounts lose money trading CFDs. Nothing on this page is financial advice and no result is promised or implied: past results do not guarantee future ones. Test on a demo account first and never risk money you cannot afford to lose.

What it is

GDI Equity Management EA watches the floating profit of your gold positions and protects it. It has two tools: a trailing lock (once the floating profit reaches a start level it secures a part of it, and closes or alerts if the profit falls back to that level) and a profit target (closes or alerts when the floating profit reaches a level). Levels are a percentage of the start-of-day balance, money, or points.

It never opens a position. Its peak is kept after a restart of the terminal. It works on gold only and on the positions you tell it to watch: those of one magic number, or every position on the chart symbol.

What it can do

The operating modes

1) Alert only (default)

When the trailing lock or the profit target is reached the EA sends a message and leaves every position open. The target alert is sent once until the positions are flat; the lock alert re-arms on every new peak.

Use it when: Use it when you manage the trades yourself and want a reminder to bank profit, or while you test the levels on a demo account.

Do not use it when: Do not rely on it to protect the account while you are away: it only warns.

2) Automatic trading - standard

When the trailing lock or the target is reached the EA closes the positions it watches. It still never opens a trade.

Use it when: Use it when you want the profit banked automatically, for example on a VPS, after testing the levels on a demo account.

Do not use it when: Do not use it with a magic number of 0 on an account where you also hold long-term trades by hand, unless you want those closed as well. This EA has no light grid mode because it does not trade.

Risks

Gold (XAUUSD) is quoted as a CFD by most brokers. CFDs are complex instruments and carry a high risk of losing money quickly because of leverage. Most retail accounts lose money trading CFDs. Nothing on this page is financial advice and no result is promised or implied: past results do not guarantee future ones. Test on a demo account first and never risk money you cannot afford to lose.

Requirements

RequirementDetail
PlatformMetaTrader 5 (an .ex5 file; not MetaTrader 4).
SymbolGold only: XAUUSD with or without a broker suffix, or GOLD. On any other symbol the EA refuses to start. It adds nothing else to Market Watch.
Account typeHedging or netting.
GDI KeyRequired to run it. The files are free to download.
Terminal settingsTools > Options > Expert Advisors: tick “Allow WebRequest for listed URL” and add https://sync.golddailyinsights.com.

Download and licence

Free to download: GDI_Equity_Management_EA.ex5 (compiled program), GDI_Equity_Management_EA.set (every input at its factory value, GDI Key empty) and GDI_Equity_Management_EA.zip (both files and an install note). Running it needs a GDI Key typed into InpGdiKey. The licence is checked at start and every hour; a lapsed key pauses new trades and never closes positions that are already open.

Build check: compiled with MetaEditor, 0 errors and 0 warnings. SHA-256 of the .ex5: 4d7e2bb6daa31d2a8cf3fddd3dabd15df45dd839c531b364a31de2f2a5ad6a63. Compare it with the file you downloaded if you want to be sure it is unchanged. How the key works: GDI Key and licence check.

Installation and first run

  1. Download the .ex5 file and, if you want the factory settings as a file, the .set file (links at the top of this page).
  2. In MetaTrader 5 choose File > Open Data Folder, open MQL5/Experts and copy the .ex5 there. Restart the terminal or right-click Expert Advisors in the Navigator and choose Refresh.
  3. Open Tools > Options > Expert Advisors, tick “Allow WebRequest for listed URL” and add https://sync.golddailyinsights.com.
  4. Open a gold chart (XAUUSD, with or without your broker’s suffix, or GOLD) and drag the EA onto it. The EA refuses to start on any other symbol.
  5. On the Inputs tab choose Load and pick the .set file for the factory settings, then type your GDI Key into InpGdiKey. The key is never stored in the .set file.
  6. On the chart’s Common tab tick “Allow Algo Trading” only if you use a mode that closes or trades; Alert only does not need it
  7. Open the Experts tab: you should see the licence confirmed and then the EA’s own status messages.

Inputs explained, one by one

Inputs are listed in the order MetaTrader 5 shows them, from the top. Values in code are what you can type; the bold default is the factory setting in the .set file. The key input is secret: type your GDI Key on the Inputs tab, never into a file or a screenshot.

Operating mode

When to use this group: Choose Alert only to be warned, or Automatic trading - standard to let the EA close the positions at the lock or the target.

InputDefaultValuesWhat it doesWhen to use it, when not
InpOperatingMode1) Alert only (default): warns you, never closes anything1 = 1) Alert only (default): warns you, never closes anything
2 = 2) Automatic trading - standard: closes positions at the lock or the target
Operating mode (this EA never opens trades; there is no grid mode)Leave at the default unless the group note above applies to you.

GDI Key

When to use this group: Your licence key. A lapsed key pauses the EA; it never closes or changes a position by itself.

InputDefaultValuesWhat it doesWhen to use it, when not
InpGdiKey(empty)textGDI KeyLeave at the default unless the group note above applies to you.

Closing

When to use this group: Slippage allowed when the EA closes a position.

InputDefaultValuesWhat it doesWhen to use it, when not
InpSlippage0a numberSlippage allowed when closing, in points (0 = automatic by symbol)Leave at the default unless the group note above applies to you.

What to watch

When to use this group: Which positions the EA protects.

InputDefaultValuesWhat it doesWhen to use it, when not
InpFilterModeOnly positions with the magic number below0 = Only positions with the magic number below
1 = Every position on this chart's symbol
Which positions to protect on this chart's symbolMagic only is the safe choice. All orders on symbol also covers positions you opened by hand and by other robots.
InpMagic0a numberMagic number to protect (0 = trades opened by hand)0 = trades opened by hand. Use the magic of the robot you want to protect.

Profit protection

When to use this group: The two tools: the trailing lock and the profit target. Start with the lock a little below the start level.

InputDefaultValuesWhat it doesWhen to use it, when not
InpTrailingModePercent of start-of-day balance0 = Cash (account currency)
1 = Percent of start-of-day balance
2 = Points x open volume (depends on the symbol)
Levels are set asPercent of the start-of-day balance, or money, or points.
InpEnableTrailingtruetrue or falseUse the trailing lockOn if you want to lock part of a running profit.
InpTrailingStart1.0a numberTrailing lock starts when the floating profit reachesFloating profit at which the lock starts. Must be above the locked level.
InpTrailingLock0.5a numberProfit it secures once started (must be below the start level)Profit secured once the lock has started. Must be below the start level.
InpEnableHardTargettruetrue or falseUse a profit targetOn if you want a fixed take-profit for the whole floating profit.
InpTargetProfit2.0a numberClose everything when the floating profit reachesFloating profit at which everything is closed (mode 2) or you are alerted (mode 1).
InpNotifProfittruetrue or falseSend a message for trailing and target eventsLeave at the default unless the group note above applies to you.

Messages

When to use this group: Where the messages go.

InputDefaultValuesWhat it doesWhen to use it, when not
InpGlobalNotifRoutingPush notification (MetaQuotes ID)0 = None (Experts log only)
1 = Terminal pop-up alert
2 = Push notification (MetaQuotes ID)
3 = Sound
4 = E-mail
5 = All channels
Where messages goPush needs your MetaQuotes ID in the terminal options.
InpGlobalNotifSoundalert.wavtextSound file (when sound is chosen)Leave at the default unless the group note above applies to you.

Frequently asked questions

Does it open trades?
Never. It only watches and, in mode 2, closes.
What does it watch?
Either the positions of one magic number on the chart symbol, or every position on that symbol, as you choose with InpFilterMode. A magic of 0 means trades opened by hand.
What if I change the mode while positions are open?
The saved state of the other mode is cleared, so a day marked in alert mode does not make the close mode act or stay silent. Test this on a demo account; it was checked in the code but not with live positions.
Which symbols?
Gold only. On any other symbol the EA refuses to start.
Does it guarantee profit?
No. It can only act on profit that already exists, and a fast market can move past a level before the EA acts.

The Author’s Kit

Used by the author Four of the GDI Expert Advisors are the ones I run on my own accounts: the Signal Copier, Equity Management, Risk Management and the Market Assistant. Together they cover copying, protecting the account, controlling risk and reading the market. All four are covered by a GDI Key; see GDI Key for the plans.

Other manuals

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

Next steps

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

Version 4.02, last updated 2026-12-02.

GDI Signal online (web version): follow the signal from any browser or phone, with e-mail alerts straight from the server and no VPS or computer left switched on. Automatic copying into your own account still needs MetaTrader 5 running with the GDI Signal Copier EA. Open GDI Signal online