Lean  $LEAN_TAG$
QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver Class Reference

Class in charge of resolving option strategy groups which will use the OptionStrategyPositionGroupBuyingPowerModel More...

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

Public Member Functions

 OptionStrategyPositionGroupResolver (SecurityManager securities)
 Creates the default option strategy group resolver for OptionStrategyDefinitions.AllDefinitions More...
 
 OptionStrategyPositionGroupResolver (SecurityManager securities, OptionStrategyMatcherOptions strategyMatcherOptions)
 Creates a custom option strategy group resolver 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< 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...
 
- Public Member Functions inherited from QuantConnect.Securities.Positions.IPositionGroupResolver
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...
 

Detailed Description

Class in charge of resolving option strategy groups which will use the OptionStrategyPositionGroupBuyingPowerModel

Definition at line 29 of file OptionStrategyPositionGroupResolver.cs.

Constructor & Destructor Documentation

◆ OptionStrategyPositionGroupResolver() [1/2]

QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver.OptionStrategyPositionGroupResolver ( SecurityManager  securities)

Creates the default option strategy group resolver for OptionStrategyDefinitions.AllDefinitions

Definition at line 37 of file OptionStrategyPositionGroupResolver.cs.

◆ OptionStrategyPositionGroupResolver() [2/2]

QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver.OptionStrategyPositionGroupResolver ( SecurityManager  securities,
OptionStrategyMatcherOptions  strategyMatcherOptions 
)

Creates a custom option strategy group resolver

Parameters
strategyMatcherOptionsThe option strategy matcher options instance to use
securitiesThe algorithms securities

Definition at line 47 of file OptionStrategyPositionGroupResolver.cs.

Member Function Documentation

◆ TryGroup()

bool QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver.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

Definition at line 62 of file OptionStrategyPositionGroupResolver.cs.

Here is the call graph for this function:

◆ Resolve()

PositionGroupCollection QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver.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

Implements QuantConnect.Securities.Positions.IPositionGroupResolver.

Definition at line 122 of file OptionStrategyPositionGroupResolver.cs.

Here is the call graph for this function:

◆ GetImpactedGroups()

IEnumerable<IPositionGroup> QuantConnect.Securities.Positions.OptionStrategyPositionGroupResolver.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

Implements QuantConnect.Securities.Positions.IPositionGroupResolver.

Definition at line 149 of file OptionStrategyPositionGroupResolver.cs.

Here is the caller graph for this function:

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