calc_margin
Calculate required margin for a hypothetical MetaTrader 5 order. Specify symbol, side, volume, and optional price to obtain margin in deposit currency.
Instructions
Broker-authoritative margin for a hypothetical order.
Wraps mt5.order_calc_margin. If price is omitted, uses the
current ask (buy) / bid (sell). Returned margin is in deposit
currency.
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": {
"symbol": "<symbol>",
"side": "<side>",
"volume": "<volume>"
},
"name": "calc_margin"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| side | Yes | ||
| volume | Yes | ||
| price | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| side | Yes | ||
| volume | Yes | ||
| price | Yes | ||
| margin | Yes | ||
| currency | Yes |