For the complete documentation index, see llms.txt. This page is also available as Markdown.

📈Trading with AI

The assistant can place, modify and close trades. This page explains exactly what it can do, what it cannot do, and how to keep it in check.


Enabling it

Trading is off unless four things are true at the same time:

  1. The connection uses a read write credential. A READ_ONLY API key can never trade.

  2. On OAuth, the scope mcp:trading.write was approved. Without it every trading endpoint is refused, even when configuration writes are allowed.

  3. The endpoint includes the trading toolset and is not a /readonly endpoint.

  4. The project has 100 accounts or fewer. See large projects are read only.

Example of a connection that may trade on one specific project:

https://ai.metacopier.io/p/{projectId}/mcp/x/trading

The refusal happens on MetaCopier's side, not in the assistant. Even if a model decided to try, an endpoint it has no scope for answers with an error.


The five trading tools

Tool
What it does

metacopier_open_position

Opens a position, or places a pending order, and waits for the broker to answer. The result tells you whether it worked.

metacopier_send_order

The same, but returns immediately without waiting. Faster, and it does not confirm that the trade was executed.

metacopier_modify_position

Changes the stop loss, take profit, volume or pending price of an existing position or order.

metacopier_close_position

Closes one position, or cancels one pending order.

metacopier_close_all_positions

Closes everything open on one account, and cancels its pending orders.

All five are marked destructive in the protocol, which is the signal most hosts use to ask you to confirm before the call goes out. Whether you actually get that confirmation dialog depends on your client, so treat it as a helpful extra and not as your safety net.


Parameters

Opening a position or sending an order

Parameter
Required
Meaning

accountId

yes

The account to trade on

symbol

yes

The symbol as the broker spells it, for example EURUSD or ETHUSD

orderType

yes

Buy, Sell, BuyLimit, SellLimit, BuyStop or SellStop

volume

yes

Size in lots, for example 0.1

openPrice

no

Required for the four pending types. Left out on a market order, which fills at the current price.

stopLoss

no

Price, or points when relativeTpSl is set. Omit or 0 for none.

takeProfit

no

Same as above

relativeTpSl

no

When true, stop loss and take profit are read as a distance in points from the fill price instead of an absolute price

pendingExpirySeconds

no

How long a pending order stays alive. MT4 and MT5 only, and the broker decides whether it accepts it.

comment

no

A short note on the trade. Keep it under roughly 23 characters, the rest is cut off.

Modifying

accountId and positionId are required. Everything you pass of stopLoss, takeProfit, volume and openPrice is changed, everything you leave out stays as it is.

Closing

accountId and positionId are required. pendingOnly restricts the call to cancelling an unfilled order, so a filled position is left alone.


Things worth knowing before you let it trade

Copiers still apply

A trade the assistant opens on a master account, meaning an account whose trades are copied to its follower accounts, is copied exactly like any other trade. "Buy 0.1 lots of EURUSD" on a master is not one trade, it is one trade per follower, sized by each copier's settings.

Send order does not confirm anything

metacopier_send_order returns as soon as the request is on its way. A rejection by the broker, an invalid volume or a closed market surfaces later in the account log, not in the answer you see. Prefer metacopier_open_position unless speed genuinely matters, and check the logs afterwards.

Close all is per account

metacopier_close_all_positions closes everything on one account. It does not close the whole project. If the account is a master, the closes are copied to its followers as usual.

Symbols are the broker's

Brokers name the same instrument differently: EURUSD, EURUSD.m, EURUSD_i. The assistant can list the symbols an account actually has, and it should, rather than guess. If a trade is refused with an unknown symbol, that is usually why.

Request ids

Every order carries a request id so that a repeated network attempt cannot become a second trade. This is handled for you, there is nothing to configure.


  1. Start with a read only connection and get used to what the assistant sees and how it reasons.

  2. Move to a connection that has trading but only on a demo project or a demo account while you learn its habits.

  3. When you go live, keep trading on its own connection, for example /p/{projectId}/mcp/x/trading, separate from the connection you use for everyday questions. A conversation about copier settings then has no way to place an order at all.

  4. Always name the account explicitly in your instruction, and read back what the assistant says it is about to do before you confirm.

Last updated