QuantConnect/Lean · error · RegressionTestException
Option was not delisted
Error message
Option was not delisted
What it means
Asserts _optionDelisted: the option received the final DelistingType.Delisted event. Failure means the option was never fully delisted by algorithm end. This pairs with the warning check (106) to confirm the full two-phase delisting completed.
Source
Thrown at Algorithm.CSharp/DuplicateOptionAssignmentRegressionAlgorithm.cs:177
if (!_optionAssigned)
{
throw new RegressionTestException("Option was not assigned");
}
if (!_stockAssigned)
{
throw new RegressionTestException("Stock was not assigned");
}
if (!_optionDelistedWarningReceived)
{
throw new RegressionTestException("Option delisting warning was not received");
}
if (!_optionDelisted)
{
throw new RegressionTestException("Option was not delisted");
}
if (!_orderCanceled)
{
throw new RegressionTestException("Order was not canceled");
}
var openOrders = Transactions.GetOpenOrders();
if (openOrders.Count != 0)
{
throw new RegressionTestException("There should be no open orders");
}
if (!Portfolio.Invested)
{
throw new RegressionTestException("Portfolio should be invested");
}
View on GitHub (pinned to d2c3659f87)
Solutions
- Extend the end date past the option's final delisting date.
- Confirm the DelistingType.Delisted path in the delisting provider emits for the option.
- Check that error 102 did not fire earlier and prevent the flag from being set.
Defensive patterns
Strategy: validation
Validate before calling
// Check the final-delisting phase is reached
if (!_optionDelistedWarningReceived) Log("Warning never received; final delisting cannot complete"); Prevention
- Ensure the date range reaches the final delisting date, not just the warning date.
- Confirm the delisting provider emits both Warning and Delisted phases.
- Triage earlier delisting-guard failures (102) before this postcondition.
When it happens
Trigger: The final delisting event never fired (only warning fired), or error 102 aborted first. Algorithm ended between the warning date and the final delisting date.
Common situations: Date range too short to reach the delisting date; delisting provider changed to stop emitting the final Delisted event; the option was removed from the portfolio by another path.
Related errors
- Option delisting warning was not received
- Unexpected delisting events
- Unexpected delisting warning event: {delisting}
- Unexpected delisting event: {delisting}
- Option was not sold
AI-assisted analysis of QuantConnect/Lean@d2c3659f87 (2026-08-13).
Data as JSON: /api/errors/d8edb4932ad77122.
Report an issue: GitHub.