tastytrade.watchlists

pydantic model tastytrade.watchlists.Pair(*, left_action: str, left_symbol: str, left_quantity: int, right_action: str, right_symbol: str, right_quantity: int)

Bases: TastytradeData

Dataclass that represents a specific pair in a pairs watchlist.

Show JSON schema
{
   "title": "Pair",
   "description": "Dataclass that represents a specific pair in a pairs watchlist.",
   "type": "object",
   "properties": {
      "left-action": {
         "title": "Left-Action",
         "type": "string"
      },
      "left-symbol": {
         "title": "Left-Symbol",
         "type": "string"
      },
      "left-quantity": {
         "title": "Left-Quantity",
         "type": "integer"
      },
      "right-action": {
         "title": "Right-Action",
         "type": "string"
      },
      "right-symbol": {
         "title": "Right-Symbol",
         "type": "string"
      },
      "right-quantity": {
         "title": "Right-Quantity",
         "type": "integer"
      }
   },
   "required": [
      "left-action",
      "left-symbol",
      "left-quantity",
      "right-action",
      "right-symbol",
      "right-quantity"
   ]
}

Fields:
field left_action : str [Required] (alias 'left-action')
field left_quantity : int [Required] (alias 'left-quantity')
field left_symbol : str [Required] (alias 'left-symbol')
field right_action : str [Required] (alias 'right-action')
field right_quantity : int [Required] (alias 'right-quantity')
field right_symbol : str [Required] (alias 'right-symbol')
pydantic model tastytrade.watchlists.PairsWatchlist(*, name: str, order_index: int, pairs_equations: list[Pair])

Bases: TastytradeData

Dataclass that represents a pairs watchlist object.

Show JSON schema
{
   "title": "PairsWatchlist",
   "description": "Dataclass that represents a pairs watchlist object.",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "order-index": {
         "title": "Order-Index",
         "type": "integer"
      },
      "pairs-equations": {
         "items": {
            "$ref": "#/$defs/Pair"
         },
         "title": "Pairs-Equations",
         "type": "array"
      }
   },
   "$defs": {
      "Pair": {
         "description": "Dataclass that represents a specific pair in a pairs watchlist.",
         "properties": {
            "left-action": {
               "title": "Left-Action",
               "type": "string"
            },
            "left-symbol": {
               "title": "Left-Symbol",
               "type": "string"
            },
            "left-quantity": {
               "title": "Left-Quantity",
               "type": "integer"
            },
            "right-action": {
               "title": "Right-Action",
               "type": "string"
            },
            "right-symbol": {
               "title": "Right-Symbol",
               "type": "string"
            },
            "right-quantity": {
               "title": "Right-Quantity",
               "type": "integer"
            }
         },
         "required": [
            "left-action",
            "left-symbol",
            "left-quantity",
            "right-action",
            "right-symbol",
            "right-quantity"
         ],
         "title": "Pair",
         "type": "object"
      }
   },
   "required": [
      "name",
      "order-index",
      "pairs-equations"
   ]
}

Fields:
field name : str [Required]
field order_index : int [Required] (alias 'order-index')
field pairs_equations : list[Pair] [Required] (alias 'pairs-equations')
async classmethod get(session: Session) list[Self]
async classmethod get(session: Session, name: str) Self

Fetches a list of all Tastytrade public pairs watchlists, or a specific one if a name is provided.

Parameters:
session: Session

the session to use for the request.

name: str

the name of the pairs watchlist to fetch.

pydantic model tastytrade.watchlists.PrivateWatchlist(*, name: str, watchlist_entries: list[dict[str, Any]] | None = None, group_name: str = 'default', order_index: int = 9999)

Bases: Watchlist

Dataclass that contains a private watchlist object, with functions to update, publish, modify and remove watchlists.

Show JSON schema
{
   "title": "PrivateWatchlist",
   "description": "Dataclass that contains a private watchlist object, with functions to\nupdate, publish, modify and remove watchlists.",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "watchlist-entries": {
         "anyOf": [
            {
               "items": {
                  "additionalProperties": true,
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Watchlist-Entries"
      },
      "group-name": {
         "default": "default",
         "title": "Group-Name",
         "type": "string"
      },
      "order-index": {
         "default": 9999,
         "title": "Order-Index",
         "type": "integer"
      }
   },
   "required": [
      "name"
   ]
}

Fields:

async classmethod get(session: Session) list[Self]
async classmethod get(session: Session, name: str) Self

Fetches the user’s private watchlists, or a specific one if a name is provided.

Parameters:
session: Session

the session to use for the request.

name: str

the name of the watchlist to fetch.

async classmethod remove(session: Session, name: str) None

Deletes the named private watchlist.

Parameters:
session: Session

the session to use for the request.

name: str

the name of the watchlist to delete.

add_symbol(symbol: str, instrument_type: InstrumentType) None

Adds a symbol to the watchlist.

remove_symbol(symbol: str, instrument_type: InstrumentType) None

Removes a symbol from the watchlist.

async update(session: Session) None

Updates the existing private remote watchlist.

Parameters:
session: Session

the session to use for the request.

async upload(session: Session) None

Creates a private remote watchlist identical to this local one.

Parameters:
session: Session

the session to use for the request.

pydantic model tastytrade.watchlists.PublicWatchlist(*, name: str, watchlist_entries: list[dict[str, Any]] | None = None, group_name: str = 'default', order_index: int = 9999)

Bases: Watchlist

Dataclass that contains symbols from a public watchlist.

Show JSON schema
{
   "title": "PublicWatchlist",
   "description": "Dataclass that contains symbols from a public watchlist.",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "watchlist-entries": {
         "anyOf": [
            {
               "items": {
                  "additionalProperties": true,
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Watchlist-Entries"
      },
      "group-name": {
         "default": "default",
         "title": "Group-Name",
         "type": "string"
      },
      "order-index": {
         "default": 9999,
         "title": "Order-Index",
         "type": "integer"
      }
   },
   "required": [
      "name"
   ]
}

Fields:

async classmethod get(session: Session, *, counts_only: bool = False) list[Self]
async classmethod get(session: Session, name: str) Self

Fetches a list of all Tastytrade public watchlists, or a specific one if a name is provided.

Parameters:
session: Session

the session to use for the request.

name: str

the name of the watchlist to fetch.

counts_only: bool = False

whether to only fetch the counts of the watchlists.

pydantic model tastytrade.watchlists.Watchlist(*, name: str, watchlist_entries: list[dict[str, Any]] | None = None, group_name: str = 'default', order_index: int = 9999)

Bases: TastytradeData

Show JSON schema
{
   "title": "Watchlist",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "watchlist-entries": {
         "anyOf": [
            {
               "items": {
                  "additionalProperties": true,
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Watchlist-Entries"
      },
      "group-name": {
         "default": "default",
         "title": "Group-Name",
         "type": "string"
      },
      "order-index": {
         "default": 9999,
         "title": "Order-Index",
         "type": "integer"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field group_name : str = 'default' (alias 'group-name')
field name : str [Required]
field order_index : int = 9999 (alias 'order-index')
field watchlist_entries : list[dict[str, Any]] | None = None (alias 'watchlist-entries')