trade
Execute market orders to open trading positions on forex, metals, indices, and cryptocurrencies through the XBTFX Trading API. Specify symbol, direction, volume, and optional stop-loss or take-profit levels.
Instructions
Open a new position (market order). Call get_symbol first to check volume_min/max/step. Confirm with user before executing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Trading symbol, e.g. EURUSD | |
| side | Yes | Trade direction | |
| volume | Yes | Lot size (e.g. 0.01). Must respect symbol volume constraints. | |
| sl | No | Stop loss price | |
| tp | No | Take profit price | |
| comment | No | Trade comment, max 27 ASCII chars. Prefixed with -API in MT5. | |
| idempotency_key | No | Unique key to prevent duplicate trades on retry. Auto-generated if omitted. |