A hard risk limit for MetaTrader 5's built-in AI agents

4 December 2026, 13:56
Jason Michael Mckay
0
11

MetaTrader 5 can let its built-in AI agents send trades through the terminal's MCP server. The terminal's own trading switch for that is Enabled, Manual confirmation, or Disabled. That is a permission. It is not a daily-loss, drawdown or equity-floor limit, and a limit that lives only in a prompt is not one the model has to obey.


Equity Lockdown is an account-level risk guard I already publish on the Market. It does not generate signals or open trades. You set the limits; when one is breached it cancels pending orders, closes open positions, and keeps the account flat until the next trading day. While it is attached, a position opened without a stop loss - including one an agent opens - can still receive a broker-side stop from the backstop. Once the account is locked, a new position is flattened.


The guard reacts after a fill. It does not block the order. The broker can still accept the agent's order. Equity Lockdown then places the backstop stop, or, once a limit has been breached and the account is locked for the day, it flattens the new position. That is janitor behaviour, not an interlock that stops the order from being sent. The same thing happens if the fill came from another Expert Advisor or a manual click.


I ran that on a MetaQuotes-Demo account on 3 December 2026, on the official terminal (build 6157). This was a demo session, not live trading.


First, an agent order was sent over the terminal MCP server: a buy of 0.01 lot EURUSD with no stop loss. The broker accepted it. About one second after the fill, the backstop had placed a broker-side stop on the position.


I then set an equity floor just above the account's equity so the guard would lock the account - a test setup, not a market-loss event. After the lockout, a second MCP order, again 0.01 lot EURUSD with no stop loss, was accepted by the broker and then flattened in about 0.5 seconds.


MetaTrader 5 recorded both MCP fills with deal reason Expert, the same reason it uses for an Expert Advisor. The MCP fills had magic number 0. The flatten close was placed by Equity Lockdown and carried magic number 20260812.


A prompt cannot do that work, because the fill has already happened. The limit has to sit on the account.


Equity Lockdown: https://www.mql5.com/en/market/product/192256