Lean
$LEAN_TAG$
|
Resolves position groups from a collection of positions. More...
Public Member Functions | |
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 Resolve method. More... | |
Resolves position groups from a collection of positions.
Definition at line 23 of file IPositionGroupResolver.cs.
bool QuantConnect.Securities.Positions.IPositionGroupResolver.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 |
Implemented in QuantConnect.Securities.Positions.CompositePositionGroupResolver, and QuantConnect.Securities.Positions.SecurityPositionGroupResolver.
PositionGroupCollection QuantConnect.Securities.Positions.IPositionGroupResolver.Resolve | ( | PositionCollection | positions | ) |
Resolves the position groups that exist within the specified collection of positions.
positions | The collection of positions |
Implemented in QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver, QuantConnect.Securities.Positions.CompositePositionGroupResolver, and QuantConnect.Securities.Positions.SecurityPositionGroupResolver.
IEnumerable<IPositionGroup> QuantConnect.Securities.Positions.IPositionGroupResolver.GetImpactedGroups | ( | PositionGroupCollection | groups, |
IReadOnlyCollection< IPosition > | positions | ||
) |
Determines the position groups that would be evaluated for grouping of the specified positions were passed into the 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 |
Implemented in QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver, QuantConnect.Securities.Positions.CompositePositionGroupResolver, and QuantConnect.Securities.Positions.SecurityPositionGroupResolver.