Lean
$LEAN_TAG$
|
Provides an implementation of IPositionGroupResolver that places all positions into a default group of one security. More...
Public Member Functions | |
SecurityPositionGroupResolver (IPositionGroupBuyingPowerModel buyingPowerModel) | |
Initializes a new instance of the SecurityPositionGroupResolver class More... | |
bool | TryGroup (IReadOnlyCollection< IPosition > newPositions, PositionGroupCollection currentPositions, out IPositionGroup group) |
Attempts to group the specified positions into a new IPositionGroup using an appropriate IPositionGroupBuyingPowerModel for position groups created via this resolver. More... | |
PositionGroupCollection | Resolve (PositionCollection positions) |
Resolves the position groups that exist within the specified collection of positions. More... | |
IEnumerable< IPositionGroup > | GetImpactedGroups (PositionGroupCollection groups, IReadOnlyCollection< IPosition > positions) |
Determines the position groups that would be evaluated for grouping of the specified positions were passed into the IPositionGroupResolver.Resolve method. More... | |
Provides an implementation of IPositionGroupResolver that places all positions into a default group of one security.
Definition at line 24 of file SecurityPositionGroupResolver.cs.
QuantConnect.Securities.Positions.SecurityPositionGroupResolver.SecurityPositionGroupResolver | ( | IPositionGroupBuyingPowerModel | buyingPowerModel | ) |
Initializes a new instance of the SecurityPositionGroupResolver class
buyingPowerModel | The buying power model to use for created groups |
Definition at line 32 of file SecurityPositionGroupResolver.cs.
bool QuantConnect.Securities.Positions.SecurityPositionGroupResolver.TryGroup | ( | IReadOnlyCollection< IPosition > | newPositions, |
PositionGroupCollection | currentPositions, | ||
out IPositionGroup | group | ||
) |
Attempts to group the specified positions into a new IPositionGroup using an appropriate IPositionGroupBuyingPowerModel for position groups created via this resolver.
newPositions | The positions to be grouped |
currentPositions | The currently grouped positions |
group | The grouped positions when this resolver is able to, otherwise null |
Implements QuantConnect.Securities.Positions.IPositionGroupResolver.
Definition at line 46 of file SecurityPositionGroupResolver.cs.
PositionGroupCollection QuantConnect.Securities.Positions.SecurityPositionGroupResolver.Resolve | ( | PositionCollection | positions | ) |
Resolves the position groups that exist within the specified collection of positions.
positions | The collection of positions |
Implements QuantConnect.Securities.Positions.IPositionGroupResolver.
Definition at line 66 of file SecurityPositionGroupResolver.cs.
IEnumerable<IPositionGroup> QuantConnect.Securities.Positions.SecurityPositionGroupResolver.GetImpactedGroups | ( | PositionGroupCollection | groups, |
IReadOnlyCollection< IPosition > | positions | ||
) |
Determines the position groups that would be evaluated for grouping of the specified positions were passed into the IPositionGroupResolver.Resolve method.
This function allows us to determine a set of impacted groups and run the resolver on just those groups in order to support what-if analysis
groups | The existing position groups |
positions | The positions being changed |
Implements QuantConnect.Securities.Positions.IPositionGroupResolver.
Definition at line 87 of file SecurityPositionGroupResolver.cs.