Lean
$LEAN_TAG$
|
Represents a simple option margin model. More...
Public Member Functions | |
OptionMarginModel (decimal requiredFreeBuyingPowerPercent=0) | |
Initializes a new instance of the OptionMarginModel More... | |
override decimal | GetLeverage (Security security) |
Gets the current leverage of the security More... | |
override void | SetLeverage (Security security, decimal leverage) |
Sets the leverage for the applicable securities, i.e, options. More... | |
override InitialMargin | GetInitialMarginRequiredForOrder (InitialMarginRequiredForOrderParameters parameters) |
Gets the total margin required to execute the specified order in units of the account currency including fees More... | |
override MaintenanceMargin | GetMaintenanceMargin (MaintenanceMarginParameters parameters) |
Gets the margin currently alloted to the specified holding More... | |
override InitialMargin | GetInitialMarginRequirement (InitialMarginParameters parameters) |
The margin that must be held in order to increase the position by the provided quantity More... | |
Public Member Functions inherited from QuantConnect.Securities.SecurityMarginModel | |
SecurityMarginModel () | |
Initializes a new instance of the SecurityMarginModel with no leverage (1x) More... | |
SecurityMarginModel (decimal initialMarginRequirement, decimal maintenanceMarginRequirement, decimal requiredFreeBuyingPowerPercent) | |
Initializes a new instance of the SecurityMarginModel More... | |
SecurityMarginModel (decimal leverage, decimal requiredFreeBuyingPowerPercent=0) | |
Initializes a new instance of the SecurityMarginModel More... | |
Public Member Functions inherited from QuantConnect.Securities.BuyingPowerModel | |
BuyingPowerModel () | |
Initializes a new instance of the BuyingPowerModel with no leverage (1x) More... | |
BuyingPowerModel (decimal initialMarginRequirement, decimal maintenanceMarginRequirement, decimal requiredFreeBuyingPowerPercent) | |
Initializes a new instance of the BuyingPowerModel More... | |
BuyingPowerModel (decimal leverage, decimal requiredFreeBuyingPowerPercent=0) | |
Initializes a new instance of the BuyingPowerModel More... | |
virtual HasSufficientBuyingPowerForOrderResult | HasSufficientBuyingPowerForOrder (HasSufficientBuyingPowerForOrderParameters parameters) |
Check if there is sufficient buying power to execute this order. More... | |
virtual 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... | |
virtual 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... | |
decimal | GetAmountToOrder ([NotNull]Security security, decimal targetMargin, decimal marginForOneUnit, out decimal finalMargin) |
Helper function that determines the amount to order to get to a given target safely. Meaning it will either be at or just below target always. More... | |
virtual ReservedBuyingPowerForPosition | GetReservedBuyingPowerForPosition (ReservedBuyingPowerForPositionParameters parameters) |
Gets the amount of buying power reserved to maintain the specified position More... | |
virtual BuyingPower | GetBuyingPower (BuyingPowerParameters parameters) |
Gets the buying power available for a trade More... | |
Additional Inherited Members | |
Static Public Attributes inherited from QuantConnect.Securities.BuyingPowerModel | |
static readonly IBuyingPowerModel | Null = new NullBuyingPowerModel() |
Gets an implementation of IBuyingPowerModel that does not check for sufficient buying power More... | |
Protected Member Functions inherited from QuantConnect.Securities.BuyingPowerModel | |
virtual decimal | GetMarginRemaining (SecurityPortfolioManager portfolio, Security security, OrderDirection direction) |
Gets the margin cash available for a trade More... | |
Properties inherited from QuantConnect.Securities.BuyingPowerModel | |
decimal | RequiredFreeBuyingPowerPercent [get, set] |
The percentage used to determine the required unused buying power for the account. More... | |
Represents a simple option margin model.
Options are not traded on margin. Margin requirements exist though for those portfolios with short positions. Current implementation covers only single long/naked short option positions.
Definition at line 28 of file OptionMarginModel.cs.
QuantConnect.Securities.Option.OptionMarginModel.OptionMarginModel | ( | decimal | requiredFreeBuyingPowerPercent = 0 | ) |
Initializes a new instance of the OptionMarginModel
requiredFreeBuyingPowerPercent | The percentage used to determine the required unused buying power for the account. |
Definition at line 40 of file OptionMarginModel.cs.
|
virtual |
Gets the current leverage of the security
security | The security to get leverage for |
Reimplemented from QuantConnect.Securities.BuyingPowerModel.
Definition at line 50 of file OptionMarginModel.cs.
|
virtual |
Sets the leverage for the applicable securities, i.e, options.
security | |
leverage | The new leverage |
Reimplemented from QuantConnect.Securities.BuyingPowerModel.
Definition at line 61 of file OptionMarginModel.cs.
|
virtual |
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 |
Reimplemented from QuantConnect.Securities.BuyingPowerModel.
Definition at line 72 of file OptionMarginModel.cs.
|
virtual |
Gets the margin currently alloted to the specified holding
parameters | An object containing the security |
Reimplemented from QuantConnect.Securities.BuyingPowerModel.
Definition at line 96 of file OptionMarginModel.cs.
|
virtual |
The margin that must be held in order to increase the position by the provided quantity
Reimplemented from QuantConnect.Securities.BuyingPowerModel.
Definition at line 106 of file OptionMarginModel.cs.