Provides extension methods for IPositionGroup
More...
|
static IPosition | GetPosition (this IPositionGroup group, Symbol symbol) |
| Gets the position in the group matching the provided - Parameters
-
More...
|
|
static IPositionGroup | WithQuantity (this IPositionGroup template, decimal groupQuantity, SecurityPositionGroupModel positionMananger) |
| Creates a new IPositionGroup with the specified groupQuantity . If the quantity provided equals the template's quantity then the template is returned. More...
|
|
static IPositionGroup | CreateUnitGroup (this IPositionGroup template, SecurityPositionGroupModel positionMananger) |
| Creates a new IPositionGroup with each position's quantity equaling it's unit quantity More...
|
|
static bool | IsEmpty (this IPositionGroup positionGroup) |
| Determines whether the position group is empty More...
|
|
static bool | IsInvertedOf (this IPositionGroup group, IPositionGroup other) |
| Checks whether the provided groups are in opposite sides, that is, each of their positions are in opposite sides. More...
|
|
static bool | Closes (this IPositionGroup finalGroup, IPositionGroup initialGroup) |
| Checks whether the provided groups are closing/reducing each other, that is, each of their positions are in opposite sides. More...
|
|
static string | GetUserFriendlyName (this IPositionGroup group) |
| Gets a user friendly name for the provided group More...
|
|
Provides extension methods for IPositionGroup
Definition at line 27 of file PositionGroupExtensions.cs.
◆ GetPosition()
◆ WithQuantity()
Creates a new IPositionGroup with the specified groupQuantity . If the quantity provided equals the template's quantity then the template is returned.
- Parameters
-
template | The group template |
groupQuantity | The quantity of the new group |
positionMananger | The position manager to use to resolve positions |
- Returns
- A position group with the same position ratios as the template but with the specified group quantity
Definition at line 51 of file PositionGroupExtensions.cs.
◆ CreateUnitGroup()
Creates a new IPositionGroup with each position's quantity equaling it's unit quantity
- Parameters
-
template | The group template |
- Returns
- A position group with the same position ratios as the template but with the specified group quantity
Definition at line 69 of file PositionGroupExtensions.cs.
◆ IsEmpty()
static bool QuantConnect.Securities.Positions.PositionGroupExtensions.IsEmpty |
( |
this IPositionGroup |
positionGroup | ) |
|
|
static |
Determines whether the position group is empty
- Parameters
-
positionGroup | The position group |
- Returns
- True if the position group is empty, that is, it has no positions, false otherwise
Definition at line 79 of file PositionGroupExtensions.cs.
◆ IsInvertedOf()
Checks whether the provided groups are in opposite sides, that is, each of their positions are in opposite sides.
- Parameters
-
group | The group to check |
other | The group to check against |
- Returns
- Whether the position groups are the inverted version of each other, that is, contain the same positions each on the opposite side
Definition at line 92 of file PositionGroupExtensions.cs.
◆ Closes()
static bool QuantConnect.Securities.Positions.PositionGroupExtensions.Closes |
( |
this IPositionGroup |
finalGroup, |
|
|
IPositionGroup |
initialGroup |
|
) |
| |
|
static |
Checks whether the provided groups are closing/reducing each other, that is, each of their positions are in opposite sides.
- Parameters
-
finalGroup | The final position group that would result from a trade |
initialGroup | The initial position group before a trade |
- Returns
- Whether final resulting position group is a reduction of the initial one
Definition at line 104 of file PositionGroupExtensions.cs.
◆ GetUserFriendlyName()
static string QuantConnect.Securities.Positions.PositionGroupExtensions.GetUserFriendlyName |
( |
this IPositionGroup |
group | ) |
|
|
static |
The documentation for this class was generated from the following file: