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

Defines a quantity of a security's holdings for inclusion in a position group More...

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

Public Member Functions

 Position (Symbol symbol, decimal quantity, decimal unitQuantity)
 Initializes a new instance of the Position class More...
 
 Position (Security security, decimal? quantity=null)
 Initializes a new instance of the Position class using the security's lot size as it's unit quantity. If quantity is null, then the security's holdings quantity is used. More...
 
override string ToString ()
 Returns a string that represents the current object. More...
 

Properties

Symbol Symbol [get]
 The symbol More...
 
decimal Quantity [get]
 The quantity More...
 
decimal UnitQuantity [get]
 The unit quantity. The unit quantities of a group define the group. For example, a covered call has 100 units of stock and -1 units of call contracts. More...
 
- Properties inherited from QuantConnect.Securities.Positions.IPosition
Symbol Symbol [get]
 The symbol More...
 
decimal Quantity [get]
 The quantity More...
 
decimal UnitQuantity [get]
 The unit quantity. The unit quantities of a group define the group. For example, a covered call has 100 units of stock and -1 units of call contracts. More...
 

Detailed Description

Defines a quantity of a security's holdings for inclusion in a position group

Definition at line 21 of file Position.cs.

Constructor & Destructor Documentation

◆ Position() [1/2]

QuantConnect.Securities.Positions.Position.Position ( Symbol  symbol,
decimal  quantity,
decimal  unitQuantity 
)

Initializes a new instance of the Position class

Parameters
symbolThe symbol
quantityThe quantity
unitQuantityThe position's unit quantity within its group

Definition at line 45 of file Position.cs.

◆ Position() [2/2]

QuantConnect.Securities.Positions.Position.Position ( Security  security,
decimal?  quantity = null 
)

Initializes a new instance of the Position class using the security's lot size as it's unit quantity. If quantity is null, then the security's holdings quantity is used.

Parameters
securityThe security
quantityThe quantity, if null, the security's holdings quantity is used

Definition at line 58 of file Position.cs.

Member Function Documentation

◆ ToString()

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

Returns a string that represents the current object.

Returns
A string that represents the current object.

Definition at line 65 of file Position.cs.

Property Documentation

◆ Symbol

Symbol QuantConnect.Securities.Positions.Position.Symbol
get

The symbol

Definition at line 26 of file Position.cs.

◆ Quantity

decimal QuantConnect.Securities.Positions.Position.Quantity
get

The quantity

Definition at line 31 of file Position.cs.

◆ UnitQuantity

decimal QuantConnect.Securities.Positions.Position.UnitQuantity
get

The unit quantity. The unit quantities of a group define the group. For example, a covered call has 100 units of stock and -1 units of call contracts.

Definition at line 37 of file Position.cs.


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