Message: LegDefinition

File: WebAPI/strategy_definition_2.proto

Description

Defines a leg (resolved contract) of a strategy.

Used in

StrategyNodeDefinition

Fields

contract_id

Type: uint32

Description: ID of the leg contract.

Note: If an unknown ID is received, the contract metadata can be obtained via metadata_2.ContractMetadataRequest.

node_index (deprecated)

Type: uint32

Description: Note: Use node_number instead.

node_number

Type: sint32

Description: Node number populated by server, unique between legs and nested strategies of the parent strategy, part of node_path field in order actions.

double_qty_ratio (deprecated)

Type: double

Description: Note: Use qty_ratio field instead.

qty_ratio

Type: cqg.Decimal

Description: Leg quantity ratio, signed decimal, number of leg contracts to buy(positive) or sell(negative). Must be an integer for an aggregation. Default is 1.

price_ratio

Type: double

Description: Leg price calculation ratio, signed decimal, coefficient in strategy price formula before the leg contract. Same as qty_ratio if omitted. This field has precision 1e-12 and can have maximum value of 9223372. Applicable for legs of an aggregation or a multiplicative strategy.

price_offset

Type: double

Description: Price offset for this leg (correct price format). It is only specified for legs of an aggregation or a multiplicative strategy. 0 is default.

covering_price

Type: double

Description: Price of covering future or equity contract. For exchange strategy only.

option_delta

Type: cqg.Decimal

Description: Used to calculate the quantity of equities or futures covering the option or options strategy. For exchange strategy only.

Note: Only qty_ratio sign means side of the leg (buy if positive or sell if negative).