Skip to content

BaseContract

QuantConnect.Data.Market.BaseContract

BaseContract(symbol: Union[Symbol, str, BaseContract])

Bases: Object, ISymbolProvider

Defines a base for a single contract, like an option or future contract

Initializes a new instance of the BaseContract class

This codeEntityType is protected.

Parameters:

Name Type Description Default
symbol Union[Symbol, str, BaseContract]

The contract symbol

required

symbol

symbol: Symbol

Gets the contract's symbol

id

The security identifier of the symbol

underlying_symbol

underlying_symbol: Symbol

Gets the underlying security's symbol

expiry

expiry: datetime

Gets the expiration date

time

time: datetime

Gets the local date time this contract's data was last updated

open_interest

open_interest: float

Gets the open interest

last_price

last_price: float

Gets the last price this contract traded at

volume

volume: int

Gets the last volume this contract traded at

bid_price

bid_price: float

Gets the current bid price

bid_size

bid_size: int

Get the current bid size

ask_price

ask_price: float

Gets the ask price

ask_size

ask_size: int

Gets the current ask size

to_string

to_string() -> str

Returns a string that represents the current object.

Returns:

Type Description
str

A string that represents the current object.