|
Lean
$LEAN_TAG$
|
Represents a security's model of buying power More...
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... | |
Represents a security's model of buying power
Definition at line 21 of file IBuyingPowerModel.cs.
| decimal QuantConnect.Securities.IBuyingPowerModel.GetLeverage | ( | Security | security | ) |
Gets the current leverage of the security
| security | The security to get leverage for |
Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.Future.FutureMarginModel, QuantConnect.Securities.PatternDayTradingMarginModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.Option.OptionMarginModel, and QuantConnect.Securities.CashBuyingPowerModel.
| 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
| security | The security to set leverage for |
| leverage | The 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.
| MaintenanceMargin QuantConnect.Securities.IBuyingPowerModel.GetMaintenanceMargin | ( | MaintenanceMarginParameters | parameters | ) |
Gets the margin currently allocated to the specified holding
| parameters | An object containing the security and 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.
| InitialMargin QuantConnect.Securities.IBuyingPowerModel.GetInitialMarginRequirement | ( | InitialMarginParameters | parameters | ) |
The margin that must be held in order to increase the position by the provided quantity
| parameters | An object containing the 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.
| 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 | An object containing the portfolio, the security and the order |
Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.Future.FutureMarginModel, and QuantConnect.Securities.Option.OptionMarginModel.
| HasSufficientBuyingPowerForOrderResult QuantConnect.Securities.IBuyingPowerModel.HasSufficientBuyingPowerForOrder | ( | HasSufficientBuyingPowerForOrderParameters | parameters | ) |
Check if there is sufficient buying power to execute this order.
| parameters | An object containing the portfolio, the security and the order |
Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Python.BuyingPowerModelPythonWrapper, QuantConnect.Securities.CashBuyingPowerModel, and QuantConnect.Securities.NullBuyingPowerModel.
| 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 | An object containing the portfolio, the security and the target signed buying power percentage |
Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.CashBuyingPowerModel, QuantConnect.Securities.Future.FutureMarginModel, and QuantConnect.Python.BuyingPowerModelPythonWrapper.
| 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 | An object containing the portfolio, the security and the delta buying power |
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.
| ReservedBuyingPowerForPosition QuantConnect.Securities.IBuyingPowerModel.GetReservedBuyingPowerForPosition | ( | ReservedBuyingPowerForPositionParameters | parameters | ) |
Gets the amount of buying power reserved to maintain the specified position
| parameters | A parameters object containing the security |
Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.CashBuyingPowerModel, and QuantConnect.Python.BuyingPowerModelPythonWrapper.
| BuyingPower QuantConnect.Securities.IBuyingPowerModel.GetBuyingPower | ( | BuyingPowerParameters | parameters | ) |
Gets the buying power available for a trade
| parameters | A parameters object containing the algorithm's portfolio, security, and order direction |
Implemented in QuantConnect.Securities.BuyingPowerModel, QuantConnect.Securities.CashBuyingPowerModel, and QuantConnect.Python.BuyingPowerModelPythonWrapper.