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

  1. Extend the end date past the option's final delisting date.
  2. Confirm the DelistingType.Delisted path in the delisting provider emits for the option.
  3. 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

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


AI-assisted analysis of QuantConnect/Lean@d2c3659f87 (2026-08-13). Data as JSON: /api/errors/d8edb4932ad77122. Report an issue: GitHub.