IMarginCallModel
QuantConnect.Securities.IMarginCallModel
Represents the model responsible for picking which orders should be executed during a margin call
execute_margin_call
execute_margin_call(
generated_margin_call_orders: List[SubmitOrderRequest],
) -> List[OrderTicket]
Executes synchronous orders to bring the account within margin requirements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
generated_margin_call_orders
|
List[SubmitOrderRequest]
|
These are the margin call orders that were generated by individual security margin models. |
required |
Returns:
| Type | Description |
|---|---|
List[OrderTicket]
|
The list of orders that were actually executed. |
get_margin_call_orders
get_margin_call_orders(
issue_margin_call_warning: Optional[bool],
) -> Tuple[List[SubmitOrderRequest], bool]
Scan the portfolio and the updated data for a potential margin call situation which may get the holdings below zero! If there is a margin call, liquidate the portfolio immediately before the portfolio gets sub zero.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issue_margin_call_warning
|
Optional[bool]
|
Set to true if a warning should be issued to the algorithm |
required |
Returns:
| Type | Description |
|---|---|
Tuple[List[SubmitOrderRequest], bool]
|
True for a margin call on the holdings. |