Positions History


GET positionhistory

Description

Get all historical position information accessible to the requester.

Resource URL

https://api.optionscity.com/positionhistory
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Position
Response Type Standard

Parameters

NameDescriptionRequired?Type
acct_id The account for which to fetch positions. If not provided, position information across all accounts to which the authenticated user has access will be provided. No Number
instrument_id Filter results to only include positions on the specified instrument ID. No Number
product_id Filter results to only include positions on instruments with the specified product ID. No Number
product_group_id Filter results to only include positions on instruments with the specified product group ID. No Number
embed_instrument Whether instrument, product and product group details should be embedded in each position definition. No Boolean
from_date Get positions from the specified date. Yes LocalDate*
to_date Get positions to the specified date. If not provided, the current date is assumed. No LocalDate*

Example Request

GET https://api.optionscity.com/positionhistory

Example Response

[ {
  "instrument_id" : 1,
  "acct_id" : 1,
  "quantity" : 5,
  "trade_prices" : [ {
    "price" : 10,
    "quantity" : 7
  }, {
    "price" : 11,
    "quantity" : -2
  } ]
} ]

Position Object

Description

The current position information for a single instrument/account pair. Used when reporting positions in an API query (as opposed to setting a reference position with the API).

Fields

Field Type Optional Description
instrument_id Number No The City API assigned instrument ID.
acct_id Number No The City API assigned trading account ID.
quantity Number No The position volume. A negative number indicates a net short position.
trade_prices ObjectArray No A breakdown of the quantity-price pairs traded to reach this net position.

JSON Sample

{
  "instrument_id" : 1,
  "acct_id" : 1,
  "quantity" : 5,
  "trade_prices" : [ {
    "price" : 10,
    "quantity" : 7
  }, {
    "price" : 11,
    "quantity" : -2
  } ]
}

* Date and time elements are ISO-8601 string representations