Account Positions

List Account Positions

A position with a quantity of 0 is considered closed. We purge these positions overnight.

Equity option positions will also include an expires-at timestamp.

For profit/loss calculations, you should rely on the live quote data as much as possible to ensure up-to-date calculations (see Streaming Market Data).

Path Parameters
account_number
String
required
Account number of the account
GET
/accounts/{account_number}/positions
{
    "data": {
        "items": [
            {
                "account-number": "5WT00000",
                "symbol": "AAPL",
                "instrument-type": "Equity",
                "underlying-symbol": "AAPL",
                "quantity": "100",
                "quantity-direction": "Long",
                "close-price": "282.48",
                "average-open-price": "288.7",
                "average-yearly-market-close-price": "123.18",
                "average-daily-market-close-price": "282.48",
                "multiplier": 1,
                "cost-effect": "Credit",
                "is-suppressed": false,
                "is-frozen": false,
                "restricted-quantity": "0.0",
                "realized-day-gain": "0.0",
                "realized-day-gain-effect": "None",
                "realized-day-gain-date": "2022-11-01",
                "realized-today": "0.0",
                "realized-today-effect": "None",
                "realized-today-date": "2022-11-01",
                "created-at": "2022-08-22T17:56:51.872+00:00",
                "updated-at": "2022-11-01T21:49:54.095+00:00"
            }
        ]
    },
    "context": "/accounts/5WT00000/positions"
}
Response Data Definitions
account-number
String
Your account number
average-daily-market-close-price
Decimal
Cost basis for unrealized day gain calculation
average-open-price
Decimal
A running average of the open price of the position. Cost basis for unrealized gain since open calculation
average-yearly-market-close-price
Decimal
Cost basis for unrealized year gain calculation
close-price
Decimal
Price of the instrument at market close yesterday
cost-effect
String
A tastytrade-specific value to categorize the cost of the position
Values: 
Credit, Debit, None
example: 
Credit
expires-at
DateTime
The date and time at which the position expires. Applies to futures and options.
example: 
2024-12-20T21:15:00.000+00:00
instrument-type
String
The instrument type of the position
Values: 
Equity, Equity Option, Future, Future Option, Cryptocurrency
example: 
Future Option
is-frozen
Boolean
Indicates the rare case when an admin has taken action to freeze this position. Tastytrade will do this to protect a compromised account. Frozen positions are not adjustable/tradeable.
is-suppressed
Boolean
This field is not in use anymore and can be ignored
multiplier
Integer
Indicates the notional multiplier of the position based on what is delivered if the position gets exercised/assigned. For example, equity options usually have a multiplier of `100`, meaning the option contract delivers 100 shares upon exercise.
quantity
Decimal
The quantity of your position. Some stocks can be traded in fractional quantities.
example: 
10
quantity-direction
String
Indicates the side or direction of the position. Zero means the position is closed.
Values: 
Long, Short, Zero
realized-day-gain
Decimal
An aggregate amount of profit or loss on a realized (already closed) position for the current trading day. This number is based on the position’s opening mark for the day.
realized-day-gain-date
Date
Indicates the date of realized day gain
example: 
2024-09-18
realized-day-gain-effect
String
The direction of the realized day gain. Credit means positive gain. Debit means loss.
Values: 
Credit, Debit, None
realized-today
Decimal
The total profit or loss realized from a position since it was opened.
realized-today-date
Date
Indicates the date of the realized today value.
example: 
2024-09-18
realized-today-effect
String
The direction of the realized today value. Credit means positive gain. Debit means loss.
Values: 
Credit, Debit, None
restricted-quantity
Integer
The quantity that cannot be traded or modified due to something like an expected assignment
symbol
String
Symbol of the position
example: 
./ESZ4 EW3U4 240920P5650
underlying-symbol
String
The symbol of the underlying instrument, if applicable
example: 
/ESZ4

Profit/Loss Calculations

The following are some high-level calculations you can do to see the profit/loss of your positions. These are not intended to be a copy-paste answer to all your P/L questions. The numbers you see may be slightly different from what you see when using the tastytrade application. This may be due to many factors, including which language you are using, the speed of your internet connection, the interval at which you receive quote data, etc. Please understand that the formulas we provide below are very basic, but will fit most people's needs.

You'll also find the terms realized and unrealized in the sections below. Realized profit/loss occurs when you close a position. Unrealized profit/loss occurs on any open positions. For example, suppose you are long 100 shares of ABCD stock that you bought for $10 each, and the current price of ABCD is $11. This means you have $100 of unrealized gain on the position ($1 per share). You haven't sold the shares yet, so you haven't realized the profit. Once you sell the shares, your realized gain on the position will be $100 and your unrealized gain will be $0. In other words, the unrealized gain becomes realized gain once you close some or all of the position.

In the previous example, if you were to sell only 25 of your shares at $11, your realized gain would be $25 and your unrealized gain would be $75.

Basic Formula

The basic math behind a profit/loss calculation is as follows:

For long positions
(mark - cost basis) * quantity * multiplier
For short positions
(mark - cost basis) * quantity * multiplier

The cost basis of the formula will differ depending on what type of gain you are calculating. Continue reading below for a description of each of these terms and a few helpful profit/loss formulas.

Mark

This is the current market value of a single unit of your position. You can think of this as the market value per unit. For long positions, you can use the quote.bid. For short positions, you can use the quote.ask. If you don't want to worry about long or short, you can use the mid price, which is calculated by (quote.bid + quote.ask) / 2. The quote.last price works too if you can't get a bid or ask.

You can get bidPrice & askPrice from the DXLink Quote market event (see Streaming Market Data).

Cost Basis

The cost basis will differ depending on what you are calculating. There are several cost basis values that tasty provides:

position.average-open-price - Cost basis for one unit of your position since it was opened. This is used in the Unrealized Gain calculation.

For example, if you buy 100 shares of ABCD for $10 each, your average-open-price would be $10. If you then bought 100 more shares for $11 each, your average-open-price would increase to $10.50.

position.average-daily-market-close-price - Cost basis for one unit of your position since yesterday. This is used in the Unrealized Day Gain calculation.

position.average-yearly-market-close-price - Cost basis for one unit of your position since the end of last year. This is used in the Unrealized Year Gain calculation.

Unrealized Gain

The unrealized profit/loss on the position since it was opened.

For long positions
(mark - position.average-open-price) * position.quantity * position.multiplier
For short positions
(position.average-open-price - mark) * position.quantity * position.multiplier

Unrealized Day Gain

The unrealized profit/loss on the position today.

For long positions
(mark - position.average-daily-market-close-price) * position.quantity * position.multiplier
For short positions
(position.average-daily-market-close-price - mark) * position.quantity * position.multiplier

Realized Gain

The profit/loss made from closing some or all of the position since it was opened.

position.realized-today

realized-today-date is the date any profit/loss was realized. If it is not today's date, you can ignore the realized-today value.

Realized Day Gain

The profit/loss from closing some or all of a position today.

position.realized-day-gain

realized-day-gain-date is the date any profit/loss was realized. If it is not today's date, you can ignore the realized-day-gain value.

P/L Open

The total (realized + unrealized) profit/loss on the position since it was opened.

unrealized gain since position open + realized gain since position open

P/L Day

The total (realized + unrealized) profit/loss on the position today.

unrealized day gain + realized day gain

Position Current Value

The net liquidating value of the position, or the value you'd receive/pay if you closed it.

mark * position.quantity * multiplier