place_order
Places an order. idempotency_key is REQUIRED: if the same (user, key) arrives a second time the stored response is returned and a second order is NEVER opened. scope=paper runs on the paper engine, scope=live runs through live execution. The policy wall runs server-side; a violation means a hard reject + audit entry.
Same arguments as simulate_order; a call with the arguments of a simulation places
that order. Missing required fields are returned together in ONE error.
AMOUNT FIELDS: margin_usd is the collateral, size_usd the position value.
SIZE FIELD DEPENDS ON MARKET: forex/MT5 -> `lots` (used exactly as given, never
rounded to a fixed value); crypto -> EXACTLY ONE of size_usd/margin_usd/risk_pct.
`leverage` is not used for forex (the product is unleveraged).
ACCOUNTS: when the user has several accounts in the same market (two MT5 accounts,
'Binance' + 'Binance2'), `account` selects one; without it the order is NOT placed
and the candidate accounts are returned — it never falls back to a default account.
`warnings` in the response mean the order differs from the request.Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"venue": "<venue>",
"symbol": "<symbol>",
"side": "<side>",
"order_type": "<order_type>",
"idempotency_key": "<idempotency_key>"
},
"name": "place_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sl | No | Stop-loss PRICE. Below entry for long, above entry for short. Optional: when omitted, the user's saved SL percentage is applied (reported in `prefs_used`); `sl_pct` takes a percentage instead of a price. A value sent here overrides the saved setting. SL remains mandatory: if neither a value nor a saved setting exists, the order is NOT opened. | |
| tp | No | Take-profit PRICE. Above entry for long, below entry for short. Optional: when omitted, the user's saved TP percentage is applied (reported in `prefs_used`). A value sent here overrides the saved setting. | |
| lots | No | FOREX/MT5 trade volume in LOTS (e.g. 0.05, 0.10, 1.5). This is how size is given for forex orders — instead of size_usd/margin_usd/risk_pct. The lot size the user stated is used EXACTLY, never rounded to a fixed value; if it falls outside the broker/account limits the order is not opened and the allowed range is reported. NOT used for crypto orders. | |
| side | Yes | 'buy' (long) or 'sell' (short). The side the user stated. | |
| venue | Yes | Exchange/venue name — must be one of the user's CONNECTED accounts (e.g. binance, bybit, okx, mt5, paper). A venue that is not connected is rejected with VENUE_NOT_CONNECTED. | |
| market | No | CRYPTO market type: 'futures' (default, leveraged perpetual) or 'spot' (unleveraged, actually buys the coin). Send 'spot' if the user says spot or if their account supports spot only; on spot leverage must be 1. NOT used for forex/MT5. | |
| sl_pct | No | SL as a PERCENTAGE (e.g. 3 = 3% away from entry). The server converts it to a price from the live entry and returns the result as `sl` with `pct_used`, so no separate price lookup is involved. Cannot be combined with `sl`. Optional: when omitted, the SL percentage saved in the user's AlgoVesta account is applied (the same default used everywhere else in the product); a value sent here overrides that setting. | |
| symbol | Yes | Trading symbol, e.g. BTCUSDT, ETHUSDT, EURUSD. | |
| tp_pct | No | TP as a PERCENTAGE (e.g. 5 = 5% away from entry). The server converts it to a price from the live entry and returns the result as `tp` with `pct_used`. Cannot be combined with `tp`. Optional: when omitted, the user's saved TP percentage is applied. | |
| account | No | TARGET ACCOUNT — the account this call acts on (for place_order/simulate_order the account the order is opened in; for close/modify the account holding the position). For MT5 the login number (e.g. '12345678'), for exchanges the account label (e.g. 'Binance2'). Copy it EXACTLY from the 'account' field in the get_portfolio_context output. REQUIRED when the user has more than one account in the same market: if left empty the action is NOT performed and the user is asked which account — it is never silently applied to the default/primary account. | |
| leverage | No | Leverage (crypto). Optional: when omitted, the leverage saved in the user's panel is applied and reported in `prefs_used`. A value sent here overrides that saved setting and changes the position size. Not used for FOREX/MT5: that product is unleveraged (1x) and size is given via lots. | |
| risk_pct | No | Percentage of the account's FREE balance to use as MARGIN (0, 100]. The position value becomes margin x leverage — this is NOT risk-based sizing and the SL distance is not used in the calculation. Can be used instead of size_usd/margin_usd — EXACTLY ONE of the three. | |
| size_usd | No | POSITION VALUE / notional (USD) — NOT the margin you put up. E.g. size_usd=100 => a $100 position (margin = 100/leverage). If the user says 'X dollars at 5x' meaning MARGIN, use margin_usd instead. Provide EXACTLY ONE of size_usd / margin_usd / risk_pct. | |
| margin_usd | No | MARGIN / collateral (USD) — the money out of your own pocket. notional = margin_usd x leverage. E.g. '$20 at 5x' => margin_usd=20 => a $100 position. This is usually what users mean by 'X dollars' with leverage. EXACTLY ONE of size_usd / margin_usd / risk_pct. | |
| order_type | Yes | 'market' or 'limit'. If 'limit', entry_price is REQUIRED. Live CRYPTO venues accept market orders only — a live crypto limit order is refused with live_limit_not_supported (never silently converted). Limit orders work on paper and on live MT5. | |
| entry_price | No | Limit order entry price. REQUIRED when order_type='limit'; not used for market orders. | |
| take_profits | No | SCALED take-profit (partial TP). A list: [{"price": 70000, "close_pct": 50}, {"price": 75000, "close_pct": 50}] — close_pct is the percentage of the position closed at that target and the TOTAL may not exceed 100%. Prices must follow target order (ascending for long, descending for short). For a single target use `tp` instead; the two cannot be sent together. | |
| idempotency_key | Yes | Client-generated unique idempotency key (min 8 characters). Reuse the SAME key when retrying the same action — the stored response is replayed and the action is NOT performed a second time. |