Module contracts

Module contracts 

Source
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§

pub use builders::*;
pub use types::*;

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§

ComboLeg
A single component within a combo contract.
Contract
Contract describes an instrument’s definition
ContractDescription
Contract data and list of derivative security types
ContractDetails
ContractDetails provides extended contract details.
DeltaNeutralContract
Delta and underlying price for Delta-Neutral combo orders. Underlying (STK or FUT), delta and underlying price goes into this attribute.
MarketRule
Minimum price increment structure for a particular market rule ID.
OptionChain
Option chain metadata for a specific underlying security.
OptionComputation
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.
PriceIncrement
Price ladder entry describing the minimum tick between price bands.
TagValue
TagValue is a convenience struct to define key-value pairs.

Enums§

ComboLegOpenClose
OpenClose specifies whether an order is an open or closing order.
SecurityType
SecurityType enumerates available security types