AI Agents Supervisor — Complete Setup & User Guide

29 May 2026, 17:29
Ho Tuan Thang
0
28
Everything you need to install and run AI Agent Supervisor on MetaTrader 5 — attach the EA, allow the AI provider URLs, paste your own API key, and set every input. The Supervisor does not trade its own chart: it watches and manages the other EAs already running on your account.

I. Install & Attach

  1. In MetaTrader 5, copy AI Agent Supervisor.ex5 into MQL5\Experts\ (or just install it from the MQL5 Market — it lands there automatically). Refresh the Navigator.
  2. Open one chart for the analysis lens — XAU/USD, H4 is recommended — and drag the EA onto it.
  3. In the EA dialog, on the Common tab, tick Allow Algo Trading. Make sure the toolbar Algo Trading button is green.
  4. Set the inputs (Section III), click OK. A smiley face + the fleet panel appear in the top-right of the chart.

One Supervisor per account is enough. It discovers and governs every EA on the account by magic number — the chart symbol it sits on is only used to read market regime, not to place trades.


II. Allow the AI URLs (required for the agents)

The Supervisor calls the AI provider directly from your terminal with your own API key. You must whitelist the provider you use:

  1. MetaTrader 5 → Tools → Options → Expert Advisors.
  2. Tick Allow WebRequest for listed URL.
  3. Click Add and paste the URL(s) for the provider(s) of the model you picked in input 1.1 / 1.2.
  4. Click OK, then restart the EA on the chart.
URL Needed when you use
https://api.openai.com Any OpenAI / GPT model
https://api.anthropic.com Any Anthropic / Claude model
https://generativelanguage.googleapis.com Any Google / Gemini model
https://api.deepseek.com (optional) DeepSeek models
https://api.x.ai (optional) xAI / Grok models

If the URL is missing you will see a WebRequest error in the Experts tab; the five-agent panel cannot run and the Supervisor falls back to its built-in regime policy. You only need the URL(s) for the provider(s) you actually selected — not all of them.


III. Full Input Reference

Group 1 — AI ENGINE

Input What it does Recommended
1.1 AIModel The main AI model used by the five analysis agents (and the backup & Q&A helper). A cost-efficient model to start (e.g. a GPT / Gemini Flash tier); upgrade once you trust it.
1.2 SupervisorPMModel The "boss" model that makes the final per-EA decision (pause / scale / close). A flagship model — this is the one decision that matters most.
1.3 AnalysisDepth How deep the debate runs: Fast (3 agents), Balanced (5 agents), Thorough (5 agents + extra debate rounds). Balanced.

Group 2 — API KEYS (fill only the one you use)

Input What it does
2.1 OpenAIKey Your OpenAI key — needed only if 1.1 / 1.2 use a GPT model.
2.2 AnthropicKey Your Anthropic key — needed only if you use a Claude model.
2.3 GoogleKey Your Google AI key — needed only if you use a Gemini model.

Your key is used only to call that provider directly from your terminal. Paste only the key for the provider behind your chosen model. No key at all? The Supervisor still runs on a simple built-in regime policy.

Group 3 — SUPERVISOR MODE

Input What it does Recommended
3.1 ExecutionMode Shadow = watch & log only, touch nothing. Approve = propose actions, you click to confirm. Live = act automatically. Start in Shadow, then Approve, then Live.
3.2 TargetMode Whole account = auto-discover and watch every EA. Specific magics = only the magics you list below. Whole account.
3.3 AIGoldEAMagics Magic numbers of your own EAs — gentle control (pause / resume / reduce lot / lock direction). Type numbers comma-separated, e.g. 123,456 . List your own EA magics here.
3.4 OtherEAMagics Magic numbers of other people's EAs — broker-side control (force-close, block exposure) because they will not take instructions. Leave blank unless you run third-party EAs.
3.5 MagicNumber The Supervisor's own ID number (used for its log files). Change only if you run two Supervisors on one terminal. Leave as is.

Both magic boxes are typed directly in the input — there is no file to manage. In Whole-account mode, any EA you do not list in AIGoldEAMagics is treated as a third-party EA.

Group 4 — RISK PROTECTION

These hard limits run independently of the AI — they can pause and flatten the whole fleet even if the agents disagree.

Input What it does Recommended
4.1 MaxDailyLossPct Daily loss cap, as a % of the day-start equity. On breach, the fleet is paused/flattened for the day. 3%
4.2 MaxWeeklyLossPct Weekly loss cap, %. 6%
4.3 EquityFloorPct Hard equity floor as a % of the initial deposit. Drop below it and the Supervisor stops everything. 80%
4.4 EnableNewsBlackout Pause new entries around high-impact news (NFP, FOMC, CPI…). On

IV. How to Run It

  1. Shadow first. Leave ExecutionMode on Shadow for a few days. The panel shows what the Supervisor would do; it touches nothing. Read the Experts tab to see its reasoning.
  2. Then Approve. Switch to Approve. Proposed actions queue up; click Approve on the panel to execute the oldest one. You stay in control of every action.
  3. Then Live. Once you trust it, switch to Live — it acts automatically within your risk limits.
  4. The panel (top-right of the chart) shows fleet health and gives one-click Pause all / Resume / Force-close buttons.
  5. See the live signals: press F3 in MT5 to open Global Variables and watch the eatctrl_* values the Supervisor sets per EA.

Letting your own EAs obey the Supervisor

Third-party EAs are handled broker-side automatically. To let your own EAs respond gently (pause, scale, lock direction, tighten stop), add the free drop-in include SupervisorClient.mqh to each of your EAs — two call sites (an entry gate and one line in OnTick). Ask the Telegram assistant for the exact snippets for your EA.


V. Quick Troubleshooting

Symptom Fix
EA won't run / no smiley Tick Allow Algo Trading in the EA dialog and the green toolbar button.
WebRequest error in Experts tab Add the provider URL (Section II) for the model you chose, then restart the EA.
Agents disabled / "no API key" Paste the key (Group 2) for the provider behind your chosen model (1.1 / 1.2).
Fleet panel is empty Check AIGoldEAMagics / OtherEAMagics , or set TargetMode = Whole account to auto-discover.
Nothing happens to my EAs You are in Shadow (log-only) — by design. Switch to Approve or Live to let it act.

Support

Supervise safely. The Supervisor only ever reduces risk — pause, scale, close. When in doubt, it waits — and so should you.