Variables for futures and options

ContractType

ContractExpiry

Type and expiration date (YYYYMM format) of the selected contract, or 0 when no valid contract was selected.

Type:

int, read/only

ContractAsk

ContractBid

ContractStrike

ContractVol

Current ask, bid, and strike price, and the trade volume of the selected contract, or 0 when no valid contract was selected. For retrieving the ask and bid prices in live trading, contractPrice must be called before.

Type:

var, read/only

ThisContract

The currently selected contract.

Contracts

The option or future chain for the current bar, asset specific, downloaded by contractUpdate. A list of CONTRACT structs of the size NumContracts.

Type:

CONTRACT*

NumContracts

The number of contracts in the chain, 0...10000.

ContractRow

The row number of the selected contract in the .t8 dataset. Can be used to retrieve further data belonging to the contract from additional datasets in the backtest.

Type:

int, read/only, asset specific.

Multiplier

Number of underlying units per option / future contract, for calculating the trade volume, selecting a contract, and filtering the options chain (default 0 = download all options). Asset specific; set it after selecting the asset and before buying contracts.

Type:

int

Examples: see Options and Futures

See also:

enterLong/Short, Contract

 

► latest version online