Lean  $LEAN_TAG$
QuantConnect.Securities.IBuyingPowerModel Interface Reference

Represents a security's model of buying power More...

Inheritance diagram for QuantConnect.Securities.IBuyingPowerModel:
[legend]

Public Member Functions

decimal GetLeverage (Security security)
 Gets the current leverage of the security More...
 
void SetLeverage (Security security, decimal leverage)
 Sets the leverage for the applicable securities, i.e, equities More...
 
MaintenanceMargin GetMaintenanceMargin (MaintenanceMarginParameters parameters)
 Gets the margin currently allocated to the specified holding More...
 
InitialMargin GetInitialMarginRequirement (InitialMarginParameters parameters)
 The margin that must be held in order to increase the position by the provided quantity More...
 
InitialMargin GetInitialMarginRequiredForOrder (InitialMarginRequiredForOrderParameters parameters)
 Gets the total margin required to execute the specified order in units of the account currency including fees More...
 
HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder (HasSufficientBuyingPowerForOrderParameters parameters)
 Check if there is sufficient buying power to execute this order. More...
 
GetMaximumOrderQuantityResult GetMaximumOrderQuantityForTargetBuyingPower (GetMaximumOrderQuantityForTargetBuyingPowerParameters parameters)
 Get the maximum market order quantity to obtain a position with a given buying power percentage. Will not take into account free buying power. More...
 
GetMaximumOrderQuantityResult GetMaximumOrderQuantityForDeltaBuyingPower (GetMaximumOrderQuantityForDeltaBuyingPowerParameters parameters)
 Get the maximum market order quantity to obtain a delta in the buying power used by a security. The deltas sign defines the position side to apply it to, positive long, negative short. More...
 
ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition (ReservedBuyingPowerForPositionParameters parameters)
 Gets the amount of buying power reserved to maintain the specified position More...
 
BuyingPower GetBuyingPower (BuyingPowerParameters parameters)
 Gets the buying power available for a trade More...
 

Detailed Description

Represents a security's model of buying power

Definition at line 21 of file IBuyingPowerModel.cs.

Member Function Documentation

◆ GetLeverage()

decimal QuantConnect.Securities.IBuyingPowerModel.GetLeverage ( Security  security)

Gets the current leverage of the security

Parameters
securityThe security to get leverage for
Returns
The current leverage in the security

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.Future.FutureMarginModel, QuantConnect.Securities.PatternDayTradingMarginModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.Option.OptionMarginModel, and QuantConnect.Securities.CashBuyingPowerModel.

Here is the caller graph for this function:

◆ SetLeverage()

void QuantConnect.Securities.IBuyingPowerModel.SetLeverage ( Security  security,
decimal  leverage 
)

Sets the leverage for the applicable securities, i.e, equities

This is added to maintain backwards compatibility with the old margin/leverage system

Parameters
securityThe security to set leverage for
leverageThe new leverage

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.Future.FutureMarginModel, QuantConnect.Securities.Option.OptionMarginModel, QuantConnect.Securities.CashBuyingPowerModel, QuantConnect.Securities.PatternDayTradingMarginModel, and QuantConnect.Securities.ConstantBuyingPowerModel.

◆ GetMaintenanceMargin()

MaintenanceMargin QuantConnect.Securities.IBuyingPowerModel.GetMaintenanceMargin ( MaintenanceMarginParameters  parameters)

Gets the margin currently allocated to the specified holding

Parameters
parametersAn object containing the security and holdings quantity/cost/value
Returns
The maintenance margin required for the provided holdings quantity/cost/value

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.Future.FutureMarginModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.Option.OptionMarginModel, QuantConnect.Securities.PatternDayTradingMarginModel, QuantConnect.Securities.Option.FuturesOptionsMarginModel, QuantConnect.Securities.ConstantBuyingPowerModel, QuantConnect.Securities.CryptoFuture.CryptoFutureMarginModel, and QuantConnect.Securities.NullBuyingPowerModel.

Here is the caller graph for this function:

◆ GetInitialMarginRequirement()

InitialMargin QuantConnect.Securities.IBuyingPowerModel.GetInitialMarginRequirement ( InitialMarginParameters  parameters)

The margin that must be held in order to increase the position by the provided quantity

Parameters
parametersAn object containing the security and quantity
Returns
The initial margin required for the provided security and quantity

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.Future.FutureMarginModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.Option.OptionMarginModel, QuantConnect.Securities.Option.FuturesOptionsMarginModel, QuantConnect.Securities.PatternDayTradingMarginModel, QuantConnect.Securities.CryptoFuture.CryptoFutureMarginModel, QuantConnect.Securities.CashBuyingPowerModel, and QuantConnect.Securities.ConstantBuyingPowerModel.

Here is the caller graph for this function:

◆ GetInitialMarginRequiredForOrder()

InitialMargin QuantConnect.Securities.IBuyingPowerModel.GetInitialMarginRequiredForOrder ( InitialMarginRequiredForOrderParameters  parameters)

Gets the total margin required to execute the specified order in units of the account currency including fees

Parameters
parametersAn object containing the portfolio, the security and the order
Returns
The total margin in terms of the currency quoted in the order

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.Future.FutureMarginModel, and QuantConnect.Securities.Option.OptionMarginModel.

◆ HasSufficientBuyingPowerForOrder()

HasSufficientBuyingPowerForOrderResult QuantConnect.Securities.IBuyingPowerModel.HasSufficientBuyingPowerForOrder ( HasSufficientBuyingPowerForOrderParameters  parameters)

Check if there is sufficient buying power to execute this order.

Parameters
parametersAn object containing the portfolio, the security and the order
Returns
Returns buying power information for an order

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.CashBuyingPowerModel, and QuantConnect.Securities.NullBuyingPowerModel.

Here is the caller graph for this function:

◆ GetMaximumOrderQuantityForTargetBuyingPower()

GetMaximumOrderQuantityResult QuantConnect.Securities.IBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower ( GetMaximumOrderQuantityForTargetBuyingPowerParameters  parameters)

Get the maximum market order quantity to obtain a position with a given buying power percentage. Will not take into account free buying power.

Parameters
parametersAn object containing the portfolio, the security and the target signed buying power percentage
Returns
Returns the maximum allowed market order quantity and if zero, also the reason

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.CashBuyingPowerModel, QuantConnect.Securities.Future.FutureMarginModel, and QuantConnect.Python.BuyingPowerModelPythonWrapper.

Here is the caller graph for this function:

◆ GetMaximumOrderQuantityForDeltaBuyingPower()

GetMaximumOrderQuantityResult QuantConnect.Securities.IBuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower ( GetMaximumOrderQuantityForDeltaBuyingPowerParameters  parameters)

Get the maximum market order quantity to obtain a delta in the buying power used by a security. The deltas sign defines the position side to apply it to, positive long, negative short.

Parameters
parametersAn object containing the portfolio, the security and the delta buying power
Returns
Returns the maximum allowed market order quantity and if zero, also the reason

Used by the margin call model to reduce the position by a delta percent.

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.CashBuyingPowerModel, and QuantConnect.Python.BuyingPowerModelPythonWrapper.

◆ GetReservedBuyingPowerForPosition()

ReservedBuyingPowerForPosition QuantConnect.Securities.IBuyingPowerModel.GetReservedBuyingPowerForPosition ( ReservedBuyingPowerForPositionParameters  parameters)

Gets the amount of buying power reserved to maintain the specified position

Parameters
parametersA parameters object containing the security
Returns
The reserved buying power in account currency

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.CashBuyingPowerModel, and QuantConnect.Python.BuyingPowerModelPythonWrapper.

Here is the caller graph for this function:

◆ GetBuyingPower()

BuyingPower QuantConnect.Securities.IBuyingPowerModel.GetBuyingPower ( BuyingPowerParameters  parameters)

Gets the buying power available for a trade

Parameters
parametersA parameters object containing the algorithm's portfolio, security, and order direction
Returns
The buying power available for the trade

Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.CashBuyingPowerModel, and QuantConnect.Python.BuyingPowerModelPythonWrapper.

Here is the caller graph for this function:

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