Discussing the article: "Building AI-Powered Trading Systems in MQL5 (Part 13): Letting the Assistant Execute Trades Behind an Approval Card"

Check out the new article: Building AI-Powered Trading Systems in MQL5 (Part 13): Letting the Assistant Execute Trades Behind an Approval Card.

We extend an MQL5 AI assistant from read-only tools to safe trade execution with a human-in-the-loop gate. The article defines action tools for placing, closing, modifying, and deleting trades and for drawing on the chart, validates each request, sizes volume to broker limits, and scopes ownership. We pause the tool loop behind an approval card, queue actions, and resume execution only after approval, which holds while auto-approval stays off, as it is by default.

Our assistant can already see charts, read indicators, list open positions and history, and reason about setups. The remaining gap is execution: it can recommend trades but cannot act on them. Simply exposing an order tool without safeguards turns helpful analysis into an operational hazard, since one incorrect symbol, wrong volume, or blind "close all" could produce real, irreversible losses. This article is for MetaQuotes Language 5 (MQL5) developers who want a practical compromise: let the assistant initiate actions, such as opening, closing, modifying, and deleting orders and drawing on the chart, while keeping a single, auditable human decision before any account change.

In our previous article (Part 12), we gave the assistant vision and read-only tools. In this article, we make the acceptance criteria explicit. An acceptable human-in-the-loop design must pause the tool loop when an action is proposed, present an approval card that spells out the exact operation and the affected trades, normalize the volume to broker limits and run basic parameter checks before execution, leaving the remaining broker rules to the trade server, scope actions to the trades the assistant is allowed to touch, and resume the conversation so the model can react to the result. We implement that flow: action tools are advertised separately from read tools, action calls are queued and gated for approval, and every execution runs through a single validated executor that enforces limits and ownership. The approval gate holds while the "Action_AutoApprove" input stays off, which is its default. We will cover the following topics:

Author: Allan Munene Mutiiria