close_by
Close two opposing positions against each other to save spread costs on hedging accounts. Use this tool to manage risk by offsetting trades of the same symbol with opposite sides.
Instructions
Close two opposing positions against each other (saves spread on smaller side). Hedging accounts only — check get_auth_status first. Returns 400 on netting accounts.
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": {
"position": "<position>",
"position_by": "<position_by>"
},
"name": "close_by"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| position | Yes | First position ticket | |
| position_by | Yes | Opposing position ticket (same symbol, opposite side) | |
| comment | No | Close-by comment, max 27 ASCII chars | |
| idempotency_key | No | Unique key to prevent duplicate close-by on retry. Auto-generated if omitted. |