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

Defines the parameters for IPositionGroupBuyingPowerModel.GetMaximumLotsForTargetBuyingPower More...

Public Member Functions

 GetMaximumLotsForTargetBuyingPowerParameters (SecurityPortfolioManager portfolio, IPositionGroup positionGroup, decimal targetBuyingPower, decimal minimumOrderMarginPortfolioPercentage, bool silenceNonErrorReasons=false)
 Initializes a new instance of the GetMaximumLotsForTargetBuyingPowerParameters class More...
 
GetMaximumLotsResult Error (string reason)
 Creates a new GetMaximumLotsResult with zero quantity and an error message. More...
 
GetMaximumLotsResult Zero ()
 Creates a new GetMaximumLotsResult with zero quantity and no message. More...
 
GetMaximumLotsResult Zero (string reason)
 Creates a new GetMaximumLotsResult with zero quantity and an info message. More...
 
GetMaximumLotsResult Result (decimal quantity)
 Creates a new GetMaximumLotsResult for the specified quantity and no message. More...
 

Properties

SecurityPortfolioManager Portfolio [get]
 Gets the algorithm's portfolio manager More...
 
IPositionGroup PositionGroup [get]
 Gets the position group More...
 
decimal TargetBuyingPower [get]
 The target buying power. More...
 
bool SilenceNonErrorReasons [get]
 True enables the IBuyingPowerModel to skip setting GetMaximumLotsResult.Reason for non error situations, for performance More...
 
decimal MinimumOrderMarginPortfolioPercentage [get]
 Configurable minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes More...
 

Detailed Description

Constructor & Destructor Documentation

◆ GetMaximumLotsForTargetBuyingPowerParameters()

QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.GetMaximumLotsForTargetBuyingPowerParameters ( SecurityPortfolioManager  portfolio,
IPositionGroup  positionGroup,
decimal  targetBuyingPower,
decimal  minimumOrderMarginPortfolioPercentage,
bool  silenceNonErrorReasons = false 
)

Initializes a new instance of the GetMaximumLotsForTargetBuyingPowerParameters class

Parameters
portfolioThe algorithm's portfolio manager
positionGroupThe position group
targetBuyingPowerThe target buying power
minimumOrderMarginPortfolioPercentageConfigurable minimum order margin portfolio percentage to ignore orders with unrealistic small sizes
silenceNonErrorReasonsTrue will not return GetMaximumLotsResult.Reason set for non error situation, this is for performance

Definition at line 60 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

Member Function Documentation

◆ Error()

GetMaximumLotsResult QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.Error ( string  reason)

Creates a new GetMaximumLotsResult with zero quantity and an error message.

Definition at line 78 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

Here is the caller graph for this function:

◆ Zero() [1/2]

GetMaximumLotsResult QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.Zero ( )

Creates a new GetMaximumLotsResult with zero quantity and no message.

Definition at line 86 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

◆ Zero() [2/2]

GetMaximumLotsResult QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.Zero ( string  reason)

Creates a new GetMaximumLotsResult with zero quantity and an info message.

Definition at line 94 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

◆ Result()

GetMaximumLotsResult QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.Result ( decimal  quantity)

Creates a new GetMaximumLotsResult for the specified quantity and no message.

Definition at line 102 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

Here is the caller graph for this function:

Property Documentation

◆ Portfolio

SecurityPortfolioManager QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.Portfolio
get

Gets the algorithm's portfolio manager

Definition at line 26 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

◆ PositionGroup

IPositionGroup QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.PositionGroup
get

Gets the position group

Definition at line 31 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

◆ TargetBuyingPower

decimal QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.TargetBuyingPower
get

The target buying power.

Sign defines the position side, positive long, negative short side.

Definition at line 37 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

◆ SilenceNonErrorReasons

bool QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.SilenceNonErrorReasons
get

True enables the IBuyingPowerModel to skip setting GetMaximumLotsResult.Reason for non error situations, for performance

Definition at line 43 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.

◆ MinimumOrderMarginPortfolioPercentage

decimal QuantConnect.Securities.Positions.GetMaximumLotsForTargetBuyingPowerParameters.MinimumOrderMarginPortfolioPercentage
get

Configurable minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes

Default value is 0. This setting is useful to avoid small trading noise when using SetHoldings

Definition at line 49 of file GetMaximumLotsForTargetBuyingPowerParameters.cs.


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