PendingRemovalsManager
QuantConnect.Lean.Engine.DataFeeds.PendingRemovalsManager
PendingRemovalsManager(order_provider: IOrderProvider)
Bases: Object
Helper class used to managed pending security removals UniverseSelection
Create a new instance
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_provider
|
IOrderProvider
|
The order provider used to determine if it is safe to remove a security |
required |
RemovedMember
is_pending_for_removal
is_pending_for_removal(
security: Security, is_internal: bool
) -> bool
is_pending_for_removal(member: Member) -> bool
Signature descriptions:
-
Will check if the security is pending for removal
-
Will check if the member is pending for removal
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
security
|
Optional[Security]
|
The security |
None
|
is_internal
|
Optional[bool]
|
Whether it's an internal subscription |
None
|
member
|
Optional[Member]
|
The universe member |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether the security is pending for removal. |
check_pending_delisted_removals
check_pending_delisted_removals() -> List[Security]
Will check the pending removals of delisted securities, see try_remove_delisted
Returns:
| Type | Description |
|---|---|
List[Security]
|
The delisted securities which can now be removed, null if none. |
check_pending_removals
check_pending_removals(
selected_symbols: HashSet[Symbol],
current_universe: Universe,
) -> List[RemovedMember]
Will check pending security removals
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selected_symbols
|
HashSet[Symbol]
|
Currently selected symbols |
required |
current_universe
|
Universe
|
Current universe |
required |
Returns:
| Type | Description |
|---|---|
List[RemovedMember]
|
The members to be removed. |
try_remove_delisted
try_remove_delisted(security: Security) -> bool
Will determine if the delisted Security can be removed from the algorithm. If it can't be removed yet, like before its delisting liquidation or while its funds settle, it's kept as a pending removal, see check_pending_delisted_removals
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
security
|
Security
|
The delisted security to remove |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the security can be removed. |
try_remove_member
try_remove_member(
member: Member, universe: Universe
) -> List[RemovedMember]
Will determine if the Security can be removed. If it can be removed will add it to pending_removals
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
member
|
Member
|
The security to remove |
required |
universe
|
Universe
|
The universe which the security is a member of |
required |
Returns:
| Type | Description |
|---|---|
List[RemovedMember]
|
The member to remove. |