Lean  $LEAN_TAG$
QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget Class Reference

Provides an implementation of IPortfolioTarget that specifies a specified quantity of a security to be held by the algorithm More...

Inheritance diagram for QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget:
[legend]

Public Member Functions

 PortfolioTarget (Symbol symbol, decimal quantity, string tag="")
 Initializes a new instance of the PortfolioTarget class More...
 
override string ToString ()
 Returns a string that represents the current object. More...
 

Static Public Member Functions

static IPortfolioTarget Percent (IAlgorithm algorithm, Symbol symbol, double percent)
 Creates a new target for the specified percent More...
 
static IPortfolioTarget Percent (IAlgorithm algorithm, Symbol symbol, double percent, string tag)
 Creates a new target for the specified percent More...
 
static IPortfolioTarget Percent (IAlgorithm algorithm, Symbol symbol, decimal percent, bool returnDeltaQuantity=false, string tag="")
 Creates a new target for the specified percent More...
 

Properties

static ? bool MinimumOrderMarginPercentageWarningSent [get, set]
 Flag to determine if the minimum order margin portfolio percentage warning should or has already been sent to the user algorithm IAlgorithmSettings.MinimumOrderMarginPortfolioPercentage More...
 
Symbol Symbol [get]
 Gets the symbol of this target More...
 
decimal Quantity [get]
 Gets the target quantity for the symbol More...
 
string Tag [get]
 Portfolio target tag with additional information More...
 
- Properties inherited from QuantConnect.Algorithm.Framework.Portfolio.IPortfolioTarget
Symbol Symbol [get]
 Gets the symbol of this target More...
 
decimal Quantity [get]
 Gets the quantity of this symbol the algorithm should hold More...
 
string Tag [get]
 Portfolio target tag with additional information More...
 

Detailed Description

Provides an implementation of IPortfolioTarget that specifies a specified quantity of a security to be held by the algorithm

Definition at line 28 of file PortfolioTarget.cs.

Constructor & Destructor Documentation

◆ PortfolioTarget()

QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.PortfolioTarget ( Symbol  symbol,
decimal  quantity,
string  tag = "" 
)

Initializes a new instance of the PortfolioTarget class

Parameters
symbolThe symbol this target is for
quantityThe target quantity
tagThe target tag with additional information

Definition at line 58 of file PortfolioTarget.cs.

Here is the caller graph for this function:

Member Function Documentation

◆ Percent() [1/3]

static IPortfolioTarget QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.Percent ( IAlgorithm  algorithm,
Symbol  symbol,
double  percent 
)
static

Creates a new target for the specified percent

Parameters
algorithmThe algorithm instance, used for getting total portfolio value and current security price
symbolThe symbol the target is for
percentThe requested target percent of total portfolio value
Returns
A portfolio target for the specified symbol/percent

Definition at line 72 of file PortfolioTarget.cs.

Here is the caller graph for this function:

◆ Percent() [2/3]

static IPortfolioTarget QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.Percent ( IAlgorithm  algorithm,
Symbol  symbol,
double  percent,
string  tag 
)
static

Creates a new target for the specified percent

Parameters
algorithmThe algorithm instance, used for getting total portfolio value and current security price
symbolThe symbol the target is for
percentThe requested target percent of total portfolio value
tagThe target tag with additional information
Returns
A portfolio target for the specified symbol/percent

Definition at line 85 of file PortfolioTarget.cs.

Here is the call graph for this function:

◆ Percent() [3/3]

static IPortfolioTarget QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.Percent ( IAlgorithm  algorithm,
Symbol  symbol,
decimal  percent,
bool  returnDeltaQuantity = false,
string  tag = "" 
)
static

Creates a new target for the specified percent

Parameters
algorithmThe algorithm instance, used for getting total portfolio value and current security price
symbolThe symbol the target is for
percentThe requested target percent of total portfolio value
returnDeltaQuantityTrue, result quantity will be the Delta required to reach target percent. False, the result quantity will be the Total quantity to reach the target percent, including current holdings
tagThe target tag with additional information
Returns
A portfolio target for the specified symbol/percent

Definition at line 100 of file PortfolioTarget.cs.

Here is the call graph for this function:

◆ ToString()

override string QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.ToString ( )

Returns a string that represents the current object.

Returns
A string that represents the current object.

<filterpriority>2</filterpriority>

Definition at line 163 of file PortfolioTarget.cs.

Property Documentation

◆ MinimumOrderMarginPercentageWarningSent

? bool QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.MinimumOrderMarginPercentageWarningSent
staticgetset

Flag to determine if the minimum order margin portfolio percentage warning should or has already been sent to the user algorithm IAlgorithmSettings.MinimumOrderMarginPortfolioPercentage

Definition at line 35 of file PortfolioTarget.cs.

◆ Symbol

Symbol QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.Symbol
get

Gets the symbol of this target

Definition at line 40 of file PortfolioTarget.cs.

◆ Quantity

decimal QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.Quantity
get

Gets the target quantity for the symbol

Definition at line 45 of file PortfolioTarget.cs.

◆ Tag

string QuantConnect.Algorithm.Framework.Portfolio.PortfolioTarget.Tag
get

Portfolio target tag with additional information

Definition at line 50 of file PortfolioTarget.cs.


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