Skip to content

Positions

Get open positions.

Positions

Request

Get open positions. All parameters are optional. If no parameters are specified, all open positions for the logged-in user are returned.

Security
SSO_TOKEN
Query
symbolstring, <= 35 characters

No default value. Base and term currency separated by a slash /.

Example:symbol=EUR/USD
levelstring, <= 32 characters

No default value. The level at which the position is calculated, case sensitive:

  • USER: user
  • LE: legal entity
  • ORG: organization
Examples:
User level
level=USER
Legal-entity level
level=LE
Organization level
level=ORG
valuestring, <= 30 characters

No default value. The ID of a specific org, legal entity, or user (depending on level).

Example:value=pfOrg
GET
/v2/positions
JavaScript
const query = new URLSearchParams({
  symbol: 'EUR/USD',
  level: 'USER',
  value: 'pfOrg'
}).toString();

const resp = await fetch(
  `https://docs.fxinside.net/_mock/openapi/integral-api-reference/rest/v2/positions?${query}`,
  {
    method: 'GET',
    headers: {
      SSO_TOKEN: 'YOUR_API_KEY_HERE'
    }
  }
);

const data = await resp.text();
console.log(data);

Responses

A list of positions for the given parameters.

Bodyapplication/json
Array [
sidestring, <= 10 characters

Long or Short.

symbolstring, <= 35 characters

Base and term currency separated by a slash / (for example EUR/USD).

valueDatestring, <= 20 characters

The value date of the trades that make up the position in the format YYYY=MM-DD.

levelstring, <= 32 characters

No default value. The level at which the position is calculated:

  • USER: user
  • LE: legal entity
  • ORG: organization
levelValuestring, <= 30 characters

The ID of either the user or organization based on the value of level.

netOpenBasenumber, (double)

Net open amount in base currency.

netOpentermnumber, (double)

Net open amount in term currency. Note the property name is not a typo ("term" is lowercase).

ratenumber, (double)

The weighted average buy or sell rate of the current position.

realizedPnLnumber, (double)

The profit or loss in the base currency determined by taking all trades (or portions thereof) that are closed and computing the profit for each pair of opposing buy/sell trades.

unrealizedPnLnumber, (double)

The profit or loss in the base currency determined by taking the position's currency pair rate against the current market rate at the position amount. Essentially, the unrealized P/L is the profit or loss if the position was closed at the current close rate.

pnlCurrencystring, <= 17 characters

The P&L reporting currency.

childrenArray of objects(position)

List of child positions, if any.

]
Response
[ { "side": "Long", "symbol": "EUR/USD", "valueDate": "2022-03-11", "level": "ORG", "levelValue": "pfOrg", "netOpenBase": 200000, "netOpenterm": 237278, "rate": 1.18639, "realizedPnL": 0, "unrealizedPnL": -22, "pnlCurrency": "USD" }, { "side": "Short", "symbol": "EUR/USD", "valueDate": "2022-03-18", "level": "ORG", "levelValue": "pfOrg", "netOpenBase": 5000000, "netOpenterm": 5933600, "rate": 1.18672, "realizedPnL": 0, "unrealizedPnL": 1600, "pnlCurrency": "USD" }, { "side": "Long", "symbol": "EUR/USD", "valueDate": "2022-03-25", "level": "ORG", "levelValue": "pfOrg", "netOpenBase": 10000000, "netOpenterm": 11865200, "rate": 1.18652, "realizedPnL": 0, "unrealizedPnL": -2400, "pnlCurrency": "USD" }, { "symbol": "EUR/USD", "valueDate": "2022-03-23", "level": "ORG", "levelValue": "pfOrg", "netOpenBase": 0, "netOpenterm": 0, "realizedPnL": -280, "unrealizedPnL": 0, "pnlCurrency": "USD" } ]