HasSufficientBuyingPowerForOrderParameters
QuantConnect.Securities.HasSufficientBuyingPowerForOrderParameters
HasSufficientBuyingPowerForOrderParameters(
portfolio: SecurityPortfolioManager,
security: Security,
order: Order,
)
Bases: Object
Defines the parameters for IBuyingPowerModel.has_sufficient_buying_power_for_order
Initializes a new instance of the HasSufficientBuyingPowerForOrderParameters class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
portfolio
|
SecurityPortfolioManager
|
The algorithm's portfolio |
required |
security
|
Security
|
The security |
required |
order
|
Order
|
The order |
required |
insufficient
insufficient(
reason: str,
) -> HasSufficientBuyingPowerForOrderResult
insufficient(
reason: FormattableString,
) -> HasSufficientBuyingPowerForOrderResult
Creates a new result indicating that there is insufficient buying power for the contemplated order
for_underlying
for_underlying(
order: Order,
) -> HasSufficientBuyingPowerForOrderParameters
Creates a new HasSufficientBuyingPowerForOrderParameters targeting the security's underlying. If the security does not implement IDerivativeSecurity then an InvalidCastException will be thrown. If the order's symbol does not match the underlying then an ArgumentException will be thrown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
Order
|
The new order targeting the underlying |
required |
Returns:
| Type | Description |
|---|---|
HasSufficientBuyingPowerForOrderParameters
|
New parameters instance suitable for invoking the sufficient capital method for the underlying security. |
sufficient
sufficient() -> HasSufficientBuyingPowerForOrderResult
Creates a new result indicating that there is sufficient buying power for the contemplated order