Developer Portal

Margin PreviewGET

Advisory preview of the additional margin needed to open `volume` lots of `symbol_id` as a market BUY and as a market SELL, priced at the current bid. Account, group, symbol and access status, holidays and quotes are checked as for a BUY; trading sessions, volume limits, exposure limits, price protection and long-only restrictions on SELL are not, so an order can still be rejected. Pending orders are margin-checked when they trigger, not when placed. `required_margin` is clamped at 0, while `used_margin_after` and `free_margin_after` reflect margin released by hedging.

View as Markdown
GET
/accounts/{account_id}/margin-preview

Authorization

AuthorizationRequiredBearer <token>

JWT token obtained from the login endpoint

In: header

Path Parameters

account_idRequiredstring

Account ID to preview the margin for

Query Parameters

symbol_idRequiredstring

Symbol to preview an order for

volumeRequirednumber

Order volume in lots

Minimum: 0Format: "double"
curl -X GET "http://localhost:8081/api/v1/accounts/acc_123456/margin-preview?symbol_id=EURUSD&volume=0.5" \
  -H "Authorization: Bearer <token>"

Margin impact of a BUY and a SELL of the given volume

{
  "account_id": "acc_123456",
  "symbol_id": "EURUSD",
  "volume": 0.5,
  "currency": "USD",
  "used_margin": 1100,
  "free_margin": 8900,
  "buy": {
    "required_margin": 550,
    "used_margin_after": 1650,
    "free_margin_after": 8350,
    "sufficient": true
  },
  "sell": {
    "required_margin": 550,
    "used_margin_after": 1650,
    "free_margin_after": 8350,
    "sufficient": true
  }
}