IPosition
QuantConnect.Securities.Positions.IPosition
Defines a position for inclusion in a group
quantity
quantity: float
The quantity
unit_quantity
unit_quantity: float
The unit quantity. The unit quantities of a group define the group. For example, a covered call has 100 units of stock and -1 units of call contracts.
combine
deduct
deduct(quantity_to_deduct: float) -> IPosition
Deducts the specified quantity_to_deduct from the specified position
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quantity_to_deduct
|
float
|
The quantity to deduct |
required |
Returns:
| Type | Description |
|---|---|
IPosition
|
A new position with the same properties but quantity reduced by the specified amount. |
get_group_quantity
get_group_quantity() -> float
Gets the quantity a group would have if the given position were part of it.
Returns:
| Type | Description |
|---|---|
float
|
The group quantity. |
with_lots
with_lots(number_of_lots: float) -> IPosition
Creates a new IPosition with quantity equal to number_of_lots times its unit quantity
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number_of_lots
|
float
|
The number of lots for the new position |
required |
Returns:
| Type | Description |
|---|---|
IPosition
|
A new position with the specified number of lots. |