# Positions

## Subscription Parameters <a href="#positions-subscribe" id="positions-subscribe"></a>

|      Parameter     |                                   Value                                  |
| :----------------: | :----------------------------------------------------------------------: |
|       **Cmd**      |                               Subscribe.txt                              |
|    **SessionId**   |                Session ID from the authentication request                |
|      **Keys**      | The ID of the trading account whose positions you would like to retrieve |
|   **EntityType**   |                                 Position                                 |
| **HttpClientType** |                                 WebSocket                                |

**Example:** { "Cmd":"Subscribe.txt", "SessionId":"7e83072e-09e7-43ed-91d5-f2b747bf162e", "Keys":"140","EntityType":"Position","HttpClientType":"WebSocket"}

## Unsubscription Parameters <a href="#positions-unsubscribe" id="positions-unsubscribe"></a>

|      Parameter     |                                       Value                                      |
| :----------------: | :------------------------------------------------------------------------------: |
|       **Cmd**      |                                  Unsubscribe.txt                                 |
|    **SessionId**   |                    Session ID from the authentication request                    |
|      **Keys**      | The ID of the trading account whose positions you would like to unsubscribe from |
|   **EntityType**   |                                     Position                                     |
| **HttpClientType** |                                     WebSocket                                    |

**Example:** { "Cmd":"Unsubscribe.txt", "SessionId":"7e83072e-09e7-43ed-91d5-f2b747bf162e", "Keys":"140","EntityType":"Position","HttpClientType":"WebSocket"}

## Message <a href="#positions-message" id="positions-message"></a>

In response to this request, you will receive all position-related information in the JSON format.

**Example:**

{

* "EntityType":"Position",
* "Id":"2785",
* "AccountId":"140",
* "SecurityId":"738835",
* "CostBasis":"96000.00000",
* "DailyCostBasis":"0.00000",
* "CreateDate":"1432634060645",
* "CreateDateOffset":"-14400000",
* "ModifyDate":"1432634060645",
* "ModifyDateOffset":"-14400000",
* "Quantity":"4.00000",
* "RealizedProfitLoss":"0.00000",
* "AverageOpenPrice":"240.00000",
* "AverageClosePrice":"0.00000",
* "SecurityType":"Option",
* "Symbol":"VMSFT160117P00030000",
* "Exchange":"VIRTEX",
* "Currency":"USD",
* "Name":"VMSFT Jan 2016 30 Put",
* "CompanyName":"",
* "UnderlyingSymbol":"VMSFT",
* "UnderlyingId":"738803",
* "UnderlyingStrike":"30.00000",
* "UnderlyingOptionType":"Put",
* "UnderlyingExpirationDate":"1452988800000",
* "UnderlyingExpirationType":"Regular"

}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-documentation.autoshares.dev/rest-api/trading-api/streaming-data/positions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
