Provides extension methods as backwards compatibility shims
More...
|
static decimal | GetReservedBuyingPowerForPosition (this IBuyingPowerModel model, Security security) |
| Gets the amount of buying power reserved to maintain the specified position More...
|
|
static HasSufficientBuyingPowerForOrderResult | HasSufficientBuyingPowerForOrder (this IBuyingPowerModel model, SecurityPortfolioManager portfolio, Security security, Order order) |
| Check if there is sufficient buying power to execute this order. More...
|
|
static GetMaximumOrderQuantityResult | GetMaximumOrderQuantityForTargetBuyingPower (this IBuyingPowerModel model, SecurityPortfolioManager portfolio, Security security, decimal target, decimal minimumOrderMarginPortfolioPercentage) |
| Get the maximum market order quantity to obtain a position with a given value in account currency More...
|
|
static decimal | GetBuyingPower (this IBuyingPowerModel model, SecurityPortfolioManager portfolio, Security security, OrderDirection direction) |
| Gets the buying power available for a trade More...
|
|
static decimal | GetMaintenanceMargin (this IBuyingPowerModel model, Security security) |
| Gets the margin currently allocated to the specified holding More...
|
|
static decimal | GetInitialMarginRequirement (this IBuyingPowerModel model, Security security, decimal quantity) |
| Gets the margin currently allocated to the specified holding More...
|
|
static bool | AboveMinimumOrderMarginPortfolioPercentage (this IBuyingPowerModel model, Security security, decimal quantity, SecurityPortfolioManager portfolioManager, decimal minimumOrderMarginPortfolioPercentage) |
| Helper method to determine if the requested quantity is above the algorithm minimum order margin portfolio percentage More...
|
|
static bool | AboveMinimumOrderMarginPortfolioPercentage (SecurityPortfolioManager portfolioManager, decimal minimumOrderMarginPortfolioPercentage, decimal absFinalOrderMargin) |
| Helper method to determine if the requested quantity is above the algorithm minimum order margin portfolio percentage More...
|
|
Provides extension methods as backwards compatibility shims
Definition at line 24 of file BuyingPowerModelExtensions.cs.
◆ GetReservedBuyingPowerForPosition()
static decimal QuantConnect.Securities.BuyingPowerModelExtensions.GetReservedBuyingPowerForPosition |
( |
this IBuyingPowerModel |
model, |
|
|
Security |
security |
|
) |
| |
|
static |
Gets the amount of buying power reserved to maintain the specified position
- Parameters
-
- Returns
- The reserved buying power in account currency
Definition at line 32 of file BuyingPowerModelExtensions.cs.
◆ HasSufficientBuyingPowerForOrder()
Check if there is sufficient buying power to execute this order.
- Parameters
-
model | The IBuyingPowerModel |
portfolio | The algorithm's portfolio |
security | The security to be traded |
order | The order |
- Returns
- Returns buying power information for an order
Definition at line 47 of file BuyingPowerModelExtensions.cs.
◆ GetMaximumOrderQuantityForTargetBuyingPower()
Get the maximum market order quantity to obtain a position with a given value in account currency
- Parameters
-
model | The IBuyingPowerModel |
portfolio | The algorithm's portfolio |
security | The security to be traded |
target | The target percent holdings |
minimumOrderMarginPortfolioPercentage | Configurable minimum order margin portfolio percentage to ignore orders with unrealistic small sizes |
- Returns
- Returns the maximum allowed market order quantity and if zero, also the reason
Definition at line 68 of file BuyingPowerModelExtensions.cs.
◆ GetBuyingPower()
Gets the buying power available for a trade
- Parameters
-
model | The IBuyingPowerModel |
portfolio | The algorithm's portfolio |
security | The security to be traded |
direction | The direction of the trade |
- Returns
- The buying power available for the trade
Definition at line 89 of file BuyingPowerModelExtensions.cs.
◆ GetMaintenanceMargin()
static decimal QuantConnect.Securities.BuyingPowerModelExtensions.GetMaintenanceMargin |
( |
this IBuyingPowerModel |
model, |
|
|
Security |
security |
|
) |
| |
|
static |
Gets the margin currently allocated to the specified holding
- Parameters
-
model | The buying power model |
security | The security |
- Returns
- The maintenance margin required for the provided holdings quantity/cost/value
Definition at line 109 of file BuyingPowerModelExtensions.cs.
◆ GetInitialMarginRequirement()
static decimal QuantConnect.Securities.BuyingPowerModelExtensions.GetInitialMarginRequirement |
( |
this IBuyingPowerModel |
model, |
|
|
Security |
security, |
|
|
decimal |
quantity |
|
) |
| |
|
static |
Gets the margin currently allocated to the specified holding
- Parameters
-
model | The buying power model |
security | The security |
quantity | The quantity of shares |
- Returns
- The initial margin required for the provided security and quantity
Definition at line 121 of file BuyingPowerModelExtensions.cs.
◆ AboveMinimumOrderMarginPortfolioPercentage() [1/2]
static bool QuantConnect.Securities.BuyingPowerModelExtensions.AboveMinimumOrderMarginPortfolioPercentage |
( |
this IBuyingPowerModel |
model, |
|
|
Security |
security, |
|
|
decimal |
quantity, |
|
|
SecurityPortfolioManager |
portfolioManager, |
|
|
decimal |
minimumOrderMarginPortfolioPercentage |
|
) |
| |
|
static |
Helper method to determine if the requested quantity is above the algorithm minimum order margin portfolio percentage
- Parameters
-
model | The buying power model |
security | The security |
quantity | The quantity of shares |
portfolioManager | The algorithm's portfolio |
minimumOrderMarginPortfolioPercentage | Minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes |
If we are trading with negative margin remaining this method will return true always
- Returns
- True if this order quantity is above the minimum requested
Definition at line 136 of file BuyingPowerModelExtensions.cs.
◆ AboveMinimumOrderMarginPortfolioPercentage() [2/2]
static bool QuantConnect.Securities.BuyingPowerModelExtensions.AboveMinimumOrderMarginPortfolioPercentage |
( |
SecurityPortfolioManager |
portfolioManager, |
|
|
decimal |
minimumOrderMarginPortfolioPercentage, |
|
|
decimal |
absFinalOrderMargin |
|
) |
| |
|
static |
Helper method to determine if the requested quantity is above the algorithm minimum order margin portfolio percentage
- Parameters
-
portfolioManager | The algorithm's portfolio |
minimumOrderMarginPortfolioPercentage | Minimum order margin portfolio percentage to ignore bad orders, orders with unrealistic small sizes |
absFinalOrderMargin | The calculated order margin value |
If we are trading with negative margin remaining this method will return true always
- Returns
- True if this order quantity is above the minimum requested
Definition at line 157 of file BuyingPowerModelExtensions.cs.
The documentation for this class was generated from the following file: