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

Defines a unique and deterministic key for IPositionGroup More...

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

Public Member Functions

 PositionGroupKey (IPositionGroupBuyingPowerModel buyingPowerModel, Security security)
 Initializes a new instance of the PositionGroupKey class for groups with a single security More...
 
 PositionGroupKey (IPositionGroupBuyingPowerModel buyingPowerModel, IReadOnlyCollection< IPosition > positions)
 Initializes a new instance of the PositionGroupKey class More...
 
IPosition[] CreateEmptyPositions ()
 Creates a new array of empty positions with unit quantities according to this key More...
 
bool Equals (PositionGroupKey other)
 Indicates whether the current object is equal to another object of the same type. More...
 
override bool Equals (object obj)
 Determines whether the specified object is equal to the current object. More...
 
override int GetHashCode ()
 Serves as the default hash function. More...
 
override string ToString ()
 Returns a string that represents the current object. More...
 

Static Public Member Functions

static bool operator== (PositionGroupKey left, PositionGroupKey right)
 Equals operator More...
 
static bool operator!= (PositionGroupKey left, PositionGroupKey right)
 Not equals operator More...
 

Properties

bool IsDefaultGroup [get]
 Gets whether or not this key defines a default group More...
 
IPositionGroupBuyingPowerModel BuyingPowerModel [get]
 Gets the IPositionGroupBuyingPowerModel being used by the group More...
 
IReadOnlyList< Tuple< Symbol, decimal > > UnitQuantities [get]
 Gets the unit quantities defining the ratio between position quantities in the group More...
 

Detailed Description

Defines a unique and deterministic key for IPositionGroup

Definition at line 25 of file PositionGroupKey.cs.

Constructor & Destructor Documentation

◆ PositionGroupKey() [1/2]

QuantConnect.Securities.Positions.PositionGroupKey.PositionGroupKey ( IPositionGroupBuyingPowerModel  buyingPowerModel,
Security  security 
)

Initializes a new instance of the PositionGroupKey class for groups with a single security

Parameters
buyingPowerModelThe group's buying power model
securityThe security

Definition at line 47 of file PositionGroupKey.cs.

◆ PositionGroupKey() [2/2]

QuantConnect.Securities.Positions.PositionGroupKey.PositionGroupKey ( IPositionGroupBuyingPowerModel  buyingPowerModel,
IReadOnlyCollection< IPosition positions 
)

Initializes a new instance of the PositionGroupKey class

Parameters
buyingPowerModelThe group's buying power model
positionsThe positions comprising the group

Definition at line 62 of file PositionGroupKey.cs.

Member Function Documentation

◆ CreateEmptyPositions()

IPosition [] QuantConnect.Securities.Positions.PositionGroupKey.CreateEmptyPositions ( )

Creates a new array of empty positions with unit quantities according to this key

Definition at line 84 of file PositionGroupKey.cs.

◆ Equals() [1/2]

bool QuantConnect.Securities.Positions.PositionGroupKey.Equals ( PositionGroupKey  other)

Indicates whether the current object is equal to another object of the same type.

Parameters
otherAn object to compare with this object.
Returns
true if the current object is equal to the other parameter; otherwise, false.

Definition at line 98 of file PositionGroupKey.cs.

Here is the caller graph for this function:

◆ Equals() [2/2]

override bool QuantConnect.Securities.Positions.PositionGroupKey.Equals ( object  obj)

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object; otherwise, false.

Definition at line 117 of file PositionGroupKey.cs.

Here is the call graph for this function:

◆ GetHashCode()

override int QuantConnect.Securities.Positions.PositionGroupKey.GetHashCode ( )

Serves as the default hash function.

Returns
A hash code for the current object.

Definition at line 134 of file PositionGroupKey.cs.

◆ ToString()

override string QuantConnect.Securities.Positions.PositionGroupKey.ToString ( )

Returns a string that represents the current object.

Returns
A string that represents the current object.

Definition at line 144 of file PositionGroupKey.cs.

◆ operator==()

static bool QuantConnect.Securities.Positions.PositionGroupKey.operator== ( PositionGroupKey  left,
PositionGroupKey  right 
)
static

Equals operator

Definition at line 152 of file PositionGroupKey.cs.

Here is the call graph for this function:

◆ operator!=()

static bool QuantConnect.Securities.Positions.PositionGroupKey.operator!= ( PositionGroupKey  left,
PositionGroupKey  right 
)
static

Not equals operator

Definition at line 160 of file PositionGroupKey.cs.

Here is the call graph for this function:

Property Documentation

◆ IsDefaultGroup

bool QuantConnect.Securities.Positions.PositionGroupKey.IsDefaultGroup
get

Gets whether or not this key defines a default group

Definition at line 30 of file PositionGroupKey.cs.

◆ BuyingPowerModel

IPositionGroupBuyingPowerModel QuantConnect.Securities.Positions.PositionGroupKey.BuyingPowerModel
get

Gets the IPositionGroupBuyingPowerModel being used by the group

Definition at line 35 of file PositionGroupKey.cs.

◆ UnitQuantities

IReadOnlyList<Tuple<Symbol, decimal> > QuantConnect.Securities.Positions.PositionGroupKey.UnitQuantities
get

Gets the unit quantities defining the ratio between position quantities in the group

Definition at line 40 of file PositionGroupKey.cs.


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