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
- Ensure the algorithm date range includes the option's delisting warning date.
- Confirm errors 100/101 did not fire earlier in the run (they would abort before the flag is set).
- 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
- Extend the end date past the option delisting-warning date.
- Resolve failures in earlier OnDelistings guards first (100/101), since they abort before the flag is set.
- Verify the delisting provider emits a Warning phase for the option.
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
- Option was not delisted
- 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/e1c719623400e44c.
Report an issue: GitHub.