Lean  $LEAN_TAG$
QuantConnect.Securities.Positions.IPositionGroupResolver Interface Reference

Resolves position groups from a collection of positions. More...

Inheritance diagram for QuantConnect.Securities.Positions.IPositionGroupResolver:
[legend]

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< IPositionGroupGetImpactedGroups (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...
 

Detailed Description

Resolves position groups from a collection of positions.

Definition at line 23 of file IPositionGroupResolver.cs.

Member Function Documentation

◆ TryGroup()

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.

Parameters
newPositionsThe positions to be grouped
currentPositionsThe currently grouped positions
groupThe grouped positions when this resolver is able to, otherwise null
Returns
True if this resolver can group the specified positions, otherwise false

Implemented in QuantConnect.Securities.Positions.CompositePositionGroupResolver, and QuantConnect.Securities.Positions.SecurityPositionGroupResolver.

Here is the caller graph for this function:

◆ Resolve()

PositionGroupCollection QuantConnect.Securities.Positions.IPositionGroupResolver.Resolve ( PositionCollection  positions)

Resolves the position groups that exist within the specified collection of positions.

Parameters
positionsThe collection of positions
Returns
An enumerable of position groups

Implemented in QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver, QuantConnect.Securities.Positions.CompositePositionGroupResolver, and QuantConnect.Securities.Positions.SecurityPositionGroupResolver.

Here is the caller graph for this function:

◆ GetImpactedGroups()

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

Parameters
groupsThe existing position groups
positionsThe positions being changed
Returns
An enumerable containing the position groups that could be impacted by the specified position changes

Implemented in QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver, QuantConnect.Securities.Positions.CompositePositionGroupResolver, and QuantConnect.Securities.Positions.SecurityPositionGroupResolver.

Here is the caller graph for this function:

The documentation for this interface was generated from the following file: