If IB no longer supports a contract because it has expired, LEAN doesn't throw an error, and returns an empty list of historical data.
Actual Behavior
The algorithm exists with No security definition has been found for the request error.
Potential Solution
When the error 200 occurs for history requests, we check out if the symbol has expired, and return an empty list.
Reproducing the Problem
Warm-up VX futures' algorithm.
var symbol = QuantConnect.Symbol.CreateFuture("VX", Market.CFE, new(2023, 10, 18), "VX18V23");
symbol = AddFutureContract(symbol).Symbol; // <- optional
var history = History(symbol, TimeSpan.FromDays(5), Resolution.Minute);
Checklist
[x] I have completely filled out this template
[x] I have confirmed that this issue exists on the current master branch
[x] I have confirmed that this is not a duplicate issue by searching issues
[x] I have provided detailed steps to reproduce the issue
Expected Behavior
If IB no longer supports a contract because it has expired, LEAN doesn't throw an error, and returns an empty list of historical data.
Actual Behavior
The algorithm exists with
No security definition has been found for the request
error.Potential Solution
When the error 200 occurs for history requests, we check out if the symbol has expired, and return an empty list.
Reproducing the Problem
Warm-up VX futures' algorithm.
Checklist
master
branch