Positions
Retrieve all open positions, optionally filtered by symbol. Position data is served from cache with real-time push updates, so responses reflect the latest state without delay.
Endpoint
Section titled “Endpoint”GET /v1/positions
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | No | Filter positions by symbol (e.g., ?symbol=EURUSD) |
Example Request
Section titled “Example Request”curl -X GET "https://interface.xbtfx.com/v1/positions?symbol=EURUSD" \ -H "Authorization: Bearer your_api_key_here"Response
Section titled “Response”[ { "ticket": 12345678, "symbol": "EURUSD", "side": "buy", "volume": 0.1, "price_open": 1.08757, "price_current": 1.08890, "sl": 1.08000, "tp": 1.09500, "profit": 13.30, "swap": -0.52 }]Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
ticket | integer | Position ticket number (unique identifier) |
symbol | string | Trading symbol |
side | string | Position direction: buy or sell |
volume | number | Position volume in lots |
price_open | number | Entry price |
price_current | number | Current market price |
sl | number | Stop loss price (0 if not set) |
tp | number | Take profit price (0 if not set) |
profit | number | Unrealized profit/loss |
swap | number | Accumulated swap charges |