Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed Settlement Cash Not Freed for Removed Assets #7727

Conversation

jhonabreul
Copy link
Collaborator

Description

Using DelayedSettlementModel and when manually removing option contracts with existing positions open, they get liquidated, the security is removed making the DataManager not able to scan its settlement model to apply the unsettled funds on the settlement date.

With this changes we delay the security removal just like we do with those that have open orders or positions, but for when they have unsettled funds.

Related Issue

Closes #7716

Motivation and Context

Requires Documentation Change

How Has This Been Tested?

  • Unit tests
  • Regression algorithm

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

@jaredbroad jaredbroad changed the title Delayed Settlement for Removed Option Contracts Delayed Settlement Cash Not Freed for Removed Assets Jan 30, 2024
Replace ISettlementModel UnsettledCash property with GetUnsettledCash method that returns a CashAmount instead of a decimal to include the currency
@Martin-Molinero Martin-Molinero merged commit 98a3fd4 into QuantConnect:master Feb 5, 2024
6 checks passed
@jhonabreul jhonabreul deleted the bug-7716-delayed-settlement-manually-removed-contracts branch February 5, 2024 18:15
AlexCatarino added a commit to QuantConnect/Documentation that referenced this pull request Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delayed Settlement for Removed Option Contracts
2 participants