Account protection Released 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) →
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
- Trailing lock on the floating profit with a start level and a locked level.
- Profit target on the floating profit.
- Levels as a percentage of the start-of-day balance, a money amount, or points.
- Alert only (default) or close the positions, chosen by the operating mode.
- Messages by push, e-mail, sound or terminal alert; an on-chart panel.
- Peak and state kept after a terminal restart.
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.
- An EA can lose money faster than you can react, and a stop loss is not guaranteed: a gap or slippage can take a loss past your limit.
- If the terminal, the internet connection or the VPS is off, the EA does nothing. Only stops that sit on the broker’s server still work.
- The signal, the readings and the alerts are not advice. Read the Risk disclosure.
- This EA was compiled with 0 errors and 0 warnings. Behaviour with open positions, the dashboard on a live chart and the live licence were not exercised in a live account in this build: check everything on a demo account first.
Requirements
| Requirement | Detail |
|---|---|
| Platform | MetaTrader 5 (an .ex5 file; not MetaTrader 4). |
| Symbol | Gold 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 type | Hedging or netting. |
| GDI Key | Required to run it. The files are free to download. |
| Terminal settings | Tools > 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
- Download the
.ex5file and, if you want the factory settings as a file, the.setfile (links at the top of this page). - In MetaTrader 5 choose File > Open Data Folder, open
MQL5/Expertsand copy the.ex5there. Restart the terminal or right-click Expert Advisors in the Navigator and choose Refresh. - Open Tools > Options > Expert Advisors, tick “Allow WebRequest for listed URL” and add
https://sync.golddailyinsights.com. - 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.
- On the Inputs tab choose Load and pick the
.setfile for the factory settings, then type your GDI Key intoInpGdiKey. The key is never stored in the.setfile. - 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
- 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.
| Input | Default | Values | What it does | When to use it, when not |
|---|---|---|---|---|
InpOperatingMode | 1) Alert only (default): warns you, never closes anything | 1 = 1) Alert only (default): warns you, never closes anything2 = 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.
| Input | Default | Values | What it does | When to use it, when not |
|---|---|---|---|---|
InpGdiKey | (empty) | text | GDI Key | Leave 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.
| Input | Default | Values | What it does | When to use it, when not |
|---|---|---|---|---|
InpSlippage | 0 | a number | Slippage 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.
| Input | Default | Values | What it does | When to use it, when not |
|---|---|---|---|---|
InpFilterMode | Only positions with the magic number below | 0 = Only positions with the magic number below1 = Every position on this chart's symbol | Which positions to protect on this chart's symbol | Magic only is the safe choice. All orders on symbol also covers positions you opened by hand and by other robots. |
InpMagic | 0 | a number | Magic 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.
| Input | Default | Values | What it does | When to use it, when not |
|---|---|---|---|---|
InpTrailingMode | Percent of start-of-day balance | 0 = Cash (account currency)1 = Percent of start-of-day balance2 = Points x open volume (depends on the symbol) | Levels are set as | Percent of the start-of-day balance, or money, or points. |
InpEnableTrailing | true | true or false | Use the trailing lock | On if you want to lock part of a running profit. |
InpTrailingStart | 1.0 | a number | Trailing lock starts when the floating profit reaches | Floating profit at which the lock starts. Must be above the locked level. |
InpTrailingLock | 0.5 | a number | Profit it secures once started (must be below the start level) | Profit secured once the lock has started. Must be below the start level. |
InpEnableHardTarget | true | true or false | Use a profit target | On if you want a fixed take-profit for the whole floating profit. |
InpTargetProfit | 2.0 | a number | Close everything when the floating profit reaches | Floating profit at which everything is closed (mode 2) or you are alerted (mode 1). |
InpNotifProfit | true | true or false | Send a message for trailing and target events | Leave at the default unless the group note above applies to you. |
Messages
When to use this group: Where the messages go.
| Input | Default | Values | What it does | When to use it, when not |
|---|---|---|---|---|
InpGlobalNotifRouting | Push notification (MetaQuotes ID) | 0 = None (Experts log only)1 = Terminal pop-up alert2 = Push notification (MetaQuotes ID)3 = Sound4 = E-mail5 = All channels | Where messages go | Push needs your MetaQuotes ID in the terminal options. |
InpGlobalNotifSound | alert.wav | text | Sound 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
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