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

Responsible for managing the resolution of position groups for an algorithm More...

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

Public Member Functions

virtual void Initialize (SecurityManager securities)
 Initializes a new instance of the SecurityPositionGroupModel class More...
 
bool TryCreatePositionGroup (List< Order > orders, out IPositionGroup group)
 Creates a position group for the specified order, pulling More...
 
PositionGroupCollection ResolvePositionGroups (PositionCollection positions)
 Resolves position groups using the specified collection of positions More...
 
IEnumerable< IPositionGroupGetImpactedGroups (IReadOnlyCollection< IPosition > positions)
 Determines which position groups could be impacted by changes in the specified positions More...
 
PositionGroupKey CreateDefaultKey (Security security)
 Creates a PositionGroupKey for the security's default position group More...
 
IPositionGroup GetOrCreateDefaultGroup (Security security)
 Gets or creates the default position group for the specified security More...
 

Public Attributes

bool IsOnlyDefaultGroups => Groups.IsOnlyDefaultGroups
 Gets whether or not the algorithm is using only default position groups More...
 
IPositionGroup this[PositionGroupKey key] => Groups[key]
 Gets the IPositionGroup matching the specified key . If one is not found, then a new empty position group is returned. More...
 

Static Public Attributes

static readonly SecurityPositionGroupModel Null = new NullSecurityPositionGroupModel()
 Gets an implementation of SecurityPositionGroupModel that will not group multiple securities More...
 

Protected Member Functions

virtual IPositionGroupResolver GetPositionGroupResolver ()
 Get the position group resolver instance to use More...
 

Properties

virtual IPositionGroupBuyingPowerModel PositionGroupBuyingPowerModel = new SecurityPositionGroupBuyingPowerModel() [get]
 Get's the single security position group buying power model to use More...
 
PositionGroupCollection Groups [get]
 Gets the set of currently resolved position groups More...
 

Detailed Description

Responsible for managing the resolution of position groups for an algorithm

Definition at line 27 of file SecurityPositionGroupModel.cs.

Member Function Documentation

◆ Initialize()

virtual void QuantConnect.Securities.Positions.SecurityPositionGroupModel.Initialize ( SecurityManager  securities)
virtual

Initializes a new instance of the SecurityPositionGroupModel class

Parameters
securitiesThe algorithm's security manager

Definition at line 71 of file SecurityPositionGroupModel.cs.

Here is the call graph for this function:

◆ TryCreatePositionGroup()

bool QuantConnect.Securities.Positions.SecurityPositionGroupModel.TryCreatePositionGroup ( List< Order orders,
out IPositionGroup  group 
)

Creates a position group for the specified order, pulling

Parameters
ordersThe order
groupThe resulting position group
Returns
A new position group matching the provided order

Definition at line 133 of file SecurityPositionGroupModel.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResolvePositionGroups()

PositionGroupCollection QuantConnect.Securities.Positions.SecurityPositionGroupModel.ResolvePositionGroups ( PositionCollection  positions)

Resolves position groups using the specified collection of positions

Parameters
positionsThe positions to be grouped
Returns
A collection of position groups containing all of the provided positions

Definition at line 152 of file SecurityPositionGroupModel.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetImpactedGroups()

IEnumerable<IPositionGroup> QuantConnect.Securities.Positions.SecurityPositionGroupModel.GetImpactedGroups ( IReadOnlyCollection< IPosition positions)

Determines which position groups could be impacted by changes in the specified positions

Parameters
positionsThe positions to be changed
Returns
All position groups that need to be re-evaluated due to changes in the positions

Definition at line 162 of file SecurityPositionGroupModel.cs.

Here is the call graph for this function:

◆ CreateDefaultKey()

PositionGroupKey QuantConnect.Securities.Positions.SecurityPositionGroupModel.CreateDefaultKey ( Security  security)

Creates a PositionGroupKey for the security's default position group

Definition at line 170 of file SecurityPositionGroupModel.cs.

Here is the caller graph for this function:

◆ GetOrCreateDefaultGroup()

IPositionGroup QuantConnect.Securities.Positions.SecurityPositionGroupModel.GetOrCreateDefaultGroup ( Security  security)

Gets or creates the default position group for the specified security

TODO: position group used here is the default, is this what callers want?

Definition at line 181 of file SecurityPositionGroupModel.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPositionGroupResolver()

virtual IPositionGroupResolver QuantConnect.Securities.Positions.SecurityPositionGroupModel.GetPositionGroupResolver ( )
protectedvirtual

Get the position group resolver instance to use

Returns
The position group resolver instance

Reimplemented in QuantConnect.Securities.Positions.NullSecurityPositionGroupModel.

Definition at line 191 of file SecurityPositionGroupModel.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ Null

readonly SecurityPositionGroupModel QuantConnect.Securities.Positions.SecurityPositionGroupModel.Null = new NullSecurityPositionGroupModel()
static

Gets an implementation of SecurityPositionGroupModel that will not group multiple securities

Definition at line 32 of file SecurityPositionGroupModel.cs.

◆ IsOnlyDefaultGroups

bool QuantConnect.Securities.Positions.SecurityPositionGroupModel.IsOnlyDefaultGroups => Groups.IsOnlyDefaultGroups

Gets whether or not the algorithm is using only default position groups

Definition at line 65 of file SecurityPositionGroupModel.cs.

◆ this[PositionGroupKey key]

IPositionGroup QuantConnect.Securities.Positions.SecurityPositionGroupModel.this[PositionGroupKey key] => Groups[key]

Gets the IPositionGroup matching the specified key . If one is not found, then a new empty position group is returned.

Definition at line 125 of file SecurityPositionGroupModel.cs.

Property Documentation

◆ PositionGroupBuyingPowerModel

virtual IPositionGroupBuyingPowerModel QuantConnect.Securities.Positions.SecurityPositionGroupModel.PositionGroupBuyingPowerModel = new SecurityPositionGroupBuyingPowerModel()
getprotected

Get's the single security position group buying power model to use

Definition at line 43 of file SecurityPositionGroupModel.cs.

◆ Groups

PositionGroupCollection QuantConnect.Securities.Positions.SecurityPositionGroupModel.Groups
get

Gets the set of currently resolved position groups

Definition at line 50 of file SecurityPositionGroupModel.cs.


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