QuantConnect/Lean · error · RegressionTestException

Option delisting warning was not received

Error message

Option delisting warning was not received

What it means

Postcondition: _optionDelistedWarningReceived must be true. The option must have emitted a DelistingType.Warning before the algorithm ended. Failure means the warning phase of delisting never occurred during the run.

Source

Thrown at Algorithm.CSharp/DuplicateOptionAssignmentRegressionAlgorithm.cs:172

        {
            if (!_optionSold)
            {
                throw new RegressionTestException("Option was not sold");
            }

            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");
            }

View on GitHub (pinned to d2c3659f87)

Solutions

  1. Ensure the algorithm date range includes the option's delisting warning date.
  2. Confirm errors 100/101 did not fire earlier in the run (they would abort before the flag is set).
  3. Verify the delisting warning is emitted by the Security's delisting provider for the option.
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the date range reaches the delisting-warning date
var warningDate = _option.ID.Date; // last trading date proximity
if (Time < warningDate) Log("Backtest ends before the delisting warning date");

Prevention

When it happens

Trigger: The algorithm ended before the delisting warning date, the warning event was suppressed, or the OnDelistings guard rejected it before setting the flag.

Common situations: End date moved earlier than the option's delisting-warning date; delisting date metadata changed in data; the OnDelistings precondition (101) threw earlier so the flag was never set.

Related errors


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