Lean
$LEAN_TAG$
|
Responsible for managing the resolution of position groups for an algorithm More...
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< IPositionGroup > | GetImpactedGroups (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... | |
Responsible for managing the resolution of position groups for an algorithm
Definition at line 27 of file SecurityPositionGroupModel.cs.
|
virtual |
Initializes a new instance of the SecurityPositionGroupModel class
securities | The algorithm's security manager |
Definition at line 71 of file SecurityPositionGroupModel.cs.
bool QuantConnect.Securities.Positions.SecurityPositionGroupModel.TryCreatePositionGroup | ( | List< Order > | orders, |
out IPositionGroup | group | ||
) |
Creates a position group for the specified order, pulling
orders | The order |
group | The resulting position group |
Definition at line 133 of file SecurityPositionGroupModel.cs.
PositionGroupCollection QuantConnect.Securities.Positions.SecurityPositionGroupModel.ResolvePositionGroups | ( | PositionCollection | positions | ) |
Resolves position groups using the specified collection of positions
positions | The positions to be grouped |
Definition at line 152 of file SecurityPositionGroupModel.cs.
IEnumerable<IPositionGroup> QuantConnect.Securities.Positions.SecurityPositionGroupModel.GetImpactedGroups | ( | IReadOnlyCollection< IPosition > | positions | ) |
Determines which position groups could be impacted by changes in the specified positions
positions | The positions to be changed |
Definition at line 162 of file SecurityPositionGroupModel.cs.
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.
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.
|
protectedvirtual |
Get the position group resolver instance to use
Reimplemented in QuantConnect.Securities.Positions.NullSecurityPositionGroupModel.
Definition at line 191 of file SecurityPositionGroupModel.cs.
|
static |
Gets an implementation of SecurityPositionGroupModel that will not group multiple securities
Definition at line 32 of file SecurityPositionGroupModel.cs.
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.
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.
|
getprotected |
Get's the single security position group buying power model to use
Definition at line 43 of file SecurityPositionGroupModel.cs.
|
get |
Gets the set of currently resolved position groups
Definition at line 50 of file SecurityPositionGroupModel.cs.