Lean
$LEAN_TAG$
|
Provides a default implementation of IPositionGroup More...
Public Member Functions | |
PositionGroup (IPositionGroupBuyingPowerModel buyingPowerModel, decimal quantity, params IPosition[] positions) | |
Initializes a new instance of the PositionGroup class More... | |
PositionGroup (PositionGroupKey key, decimal quantity, params IPosition[] positions) | |
Initializes a new instance of the PositionGroup class More... | |
PositionGroup (PositionGroupKey key, decimal quantity, Dictionary< Symbol, IPosition > positions) | |
Initializes a new instance of the PositionGroup class More... | |
bool | TryGetPosition (Symbol symbol, out IPosition position) |
Attempts to retrieve the position with the specified symbol More... | |
override string | ToString () |
Returns a string that represents the current object. More... | |
IEnumerator< IPosition > | GetEnumerator () |
Returns an enumerator that iterates through the collection. More... | |
Static Public Member Functions | |
static PositionGroup | Empty (IPositionGroupBuyingPowerModel buyingPowerModel) |
Instantiates a default empty position group instance More... | |
Public Attributes | |
int | Count => _positions.Count |
Gets the number of positions in the group More... | |
IEnumerable< IPosition > | Positions => _positions.Values |
Gets the positions in this group More... | |
IPositionGroupBuyingPowerModel | BuyingPowerModel => Key.BuyingPowerModel |
Gets the buying power model defining how margin works in this group More... | |
Properties | |
PositionGroupKey | Key [get] |
Gets the key identifying this group More... | |
decimal | Quantity [get] |
Gets the whole number of units in this position group More... | |
Properties inherited from QuantConnect.Securities.Positions.IPositionGroup | |
PositionGroupKey | Key [get] |
Gets the key identifying this group More... | |
decimal | Quantity [get] |
Gets the whole number of units in this position group More... | |
IEnumerable< IPosition > | Positions [get] |
Gets the positions in this group More... | |
IPositionGroupBuyingPowerModel | BuyingPowerModel [get] |
Gets the buying power model defining how margin works in this group More... | |
Provides a default implementation of IPositionGroup
Definition at line 27 of file PositionGroup.cs.
QuantConnect.Securities.Positions.PositionGroup.PositionGroup | ( | IPositionGroupBuyingPowerModel | buyingPowerModel, |
decimal | quantity, | ||
params IPosition[] | positions | ||
) |
Initializes a new instance of the PositionGroup class
buyingPowerModel | The buying power model to use for this group |
quantity | The group quantity, which must be the ratio of quantity to unit quantity of each position |
positions | The positions comprising this group |
ArgumentException | Thrown when the quantity is not the ratio of quantity to unit quantity of each position |
Definition at line 63 of file PositionGroup.cs.
QuantConnect.Securities.Positions.PositionGroup.PositionGroup | ( | PositionGroupKey | key, |
decimal | quantity, | ||
params IPosition[] | positions | ||
) |
Initializes a new instance of the PositionGroup class
key | The deterministic key for this group |
quantity | The group quantity, which must be the ratio of quantity to unit quantity of each position |
positions | The positions comprising this group |
ArgumentException | Thrown when the quantity is not the ratio of quantity to unit quantity of each position |
Definition at line 75 of file PositionGroup.cs.
QuantConnect.Securities.Positions.PositionGroup.PositionGroup | ( | PositionGroupKey | key, |
decimal | quantity, | ||
Dictionary< Symbol, IPosition > | positions | ||
) |
Initializes a new instance of the PositionGroup class
key | The deterministic key for this group |
quantity | The group quantity, which must be the ratio of quantity to unit quantity of each position |
positions | The positions comprising this group |
ArgumentException | Thrown when the quantity is not the ratio of quantity to unit quantity of each position |
Definition at line 87 of file PositionGroup.cs.
bool QuantConnect.Securities.Positions.PositionGroup.TryGetPosition | ( | Symbol | symbol, |
out IPosition | position | ||
) |
Attempts to retrieve the position with the specified symbol
symbol | The symbol |
position | The position, if found |
Implements QuantConnect.Securities.Positions.IPositionGroup.
Definition at line 107 of file PositionGroup.cs.
override string QuantConnect.Securities.Positions.PositionGroup.ToString | ( | ) |
Returns a string that represents the current object.
Definition at line 114 of file PositionGroup.cs.
IEnumerator<IPosition> QuantConnect.Securities.Positions.PositionGroup.GetEnumerator | ( | ) |
Returns an enumerator that iterates through the collection.
Definition at line 121 of file PositionGroup.cs.
|
static |
Instantiates a default empty position group instance
buyingPowerModel | The buying power model to use for this group |
Definition at line 137 of file PositionGroup.cs.
int QuantConnect.Securities.Positions.PositionGroup.Count => _positions.Count |
Gets the number of positions in the group
Definition at line 32 of file PositionGroup.cs.
IEnumerable<IPosition> QuantConnect.Securities.Positions.PositionGroup.Positions => _positions.Values |
Gets the positions in this group
Definition at line 47 of file PositionGroup.cs.
IPositionGroupBuyingPowerModel QuantConnect.Securities.Positions.PositionGroup.BuyingPowerModel => Key.BuyingPowerModel |
Gets the buying power model defining how margin works in this group
Definition at line 52 of file PositionGroup.cs.
|
get |
Gets the key identifying this group
Definition at line 37 of file PositionGroup.cs.
|
get |
Gets the whole number of units in this position group
Definition at line 42 of file PositionGroup.cs.