Expand description
A Contract object represents trading instruments such as a stocks, futures or options.
Every time a new request that requires a contract (i.e. market data, order placing, etc.) is sent to the API, the system will try to match the provided contract object with a single candidate. If there is more than one contract matching the same description, the API will return an error notifying you there is an ambiguity. In these cases the API needs further information to narrow down the list of contracts matching the provided description to a single element. Contract definitions and related functionality for trading instruments.
This module provides data structures for representing various financial instruments including stocks, options, futures, and complex securities. It includes contract creation helpers, validation, and conversion utilities.
Re-exports§
Modules§
- blocking
- Blocking contract lookup helpers backed by the synchronous transport.
- builders
- Type-safe builders for different contract types.
- tick_
types - Tick type constants used in option computations and market data.
- types
- Strong types for contract building with validation.
Structs§
- Combo
Leg - A single component within a combo contract.
- Contract
- Contract describes an instrument’s definition
- Contract
Description - Contract data and list of derivative security types
- Contract
Details - ContractDetails provides extended contract details.
- Delta
Neutral Contract - Delta and underlying price for Delta-Neutral combo orders. Underlying (STK or FUT), delta and underlying price goes into this attribute.
- Market
Rule - Minimum price increment structure for a particular market rule ID.
- Option
Chain - Option chain metadata for a specific underlying security.
- Option
Computation - Receives option specific market data. TWS’s options model volatility, prices, and deltas, along with the present value of dividends expected on that options underlier.
- Price
Increment - Price ladder entry describing the minimum tick between price bands.
- TagValue
- TagValue is a convenience struct to define key-value pairs.
Enums§
- Combo
LegOpen Close - OpenClose specifies whether an order is an open or closing order.
- Security
Type - SecurityType enumerates available security types