IPositionGroup
QuantConnect.Securities.Positions.IPositionGroup
Bases: Sequence[IPosition]
Defines a group of positions allowing for more efficient use of portfolio margin
quantity
quantity: float
Gets the whole number of units in this position group
buying_power_model
buying_power_model: IPositionGroupBuyingPowerModel
Gets the buying power model defining how margin works in this group
try_get_position
try_get_position(
symbol: Union[Symbol, str, BaseContract],
position: Optional[IPosition],
) -> Tuple[bool, IPosition]
Attempts to retrieve the position with the specified symbol
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
Union[Symbol, str, BaseContract]
|
The symbol |
required |
position
|
Optional[IPosition]
|
The position, if found |
required |
Returns:
| Type | Description |
|---|---|
Tuple[bool, IPosition]
|
True if the position was found, otherwise false. |