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.
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. |