Provides extension methods for IPosition
More...
Provides extension methods for IPosition
Definition at line 24 of file PositionExtensions.cs.
◆ Deduct()
static IPosition QuantConnect.Securities.Positions.PositionExtensions.Deduct |
( |
this IPosition |
position, |
|
|
decimal |
quantityToDeduct |
|
) |
| |
|
static |
Deducts the specified quantityToDeduct from the specified position
- Parameters
-
position | The source position |
quantityToDeduct | The quantity to deduct |
- Returns
- A new position with the same properties but quantity reduced by the specified amount
Definition at line 32 of file PositionExtensions.cs.
◆ Combine()
Combines the provided positions into a single position with the quantities added and the minimum unit quantity.
- Parameters
-
position | The position |
other | The other position to add |
- Returns
- The combined position
Definition at line 44 of file PositionExtensions.cs.
◆ Consolidate()
static Dictionary<Symbol, IPosition> QuantConnect.Securities.Positions.PositionExtensions.Consolidate |
( |
this IEnumerable< IPosition > |
positions | ) |
|
|
static |
Consolidates the provided positions into a dictionary
- Parameters
-
positions | The positions to be consolidated |
- Returns
- A dictionary containing the consolidated positions
Definition at line 62 of file PositionExtensions.cs.
◆ WithLots()
static IPosition QuantConnect.Securities.Positions.PositionExtensions.WithLots |
( |
this IPosition |
position, |
|
|
decimal |
numberOfLots |
|
) |
| |
|
static |
Creates a new IPosition with quantity equal to numberOfLots times its unit quantity
- Parameters
-
position | The position |
numberOfLots | The number of lots for the new position |
- Returns
- A new position with the specified number of lots
Definition at line 88 of file PositionExtensions.cs.
◆ GetGroupQuantity()
static decimal QuantConnect.Securities.Positions.PositionExtensions.GetGroupQuantity |
( |
this IPosition |
position | ) |
|
|
static |
Gets the quantity a group would have if the given position were part of it.
- Parameters
-
- Returns
- The group quantity
Definition at line 99 of file PositionExtensions.cs.
The documentation for this class was generated from the following file: