Outdated OptionContract is not removed from OptionChain
Expected Behavior
When an option contract fits the criteria of the filter, it will be added to the OptionChain. Likewise, if it does not fit anymore (outdated), it should be removed from the OptionChain.
Actual Behavior
Outdated OptionContract is not removed from OptionChain. The new ones would still come in, accumulating the contracts within the chain.
Potential Solution
Reproducing the Problem
https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_625c9f58fbf496c9a109fc62145ea1de.html
System Information
NA
Checklist
- [X] I have completely filled out this template
- [X] I have confirmed that this issue exists on the current
masterbranch - [X] I have confirmed that this is not a duplicate issue by searching issues
- [X] I have provided detailed steps to reproduce the issue
This behavior is on purpose to avoid a performance penalty of adding and remove the option contracts every minute, take a look at https://github.com/QuantConnect/Lean/blob/master/Common/Data/UniverseSelection/OptionChainUniverse.cs#L212, changed by https://github.com/QuantConnect/Lean/pull/943 . But they are removed on the next day though, in live trading this would happen every 15 min instead
Maybe this behavior could be refactored so that it respects the given UniverseSettings.MinimumTimeInUniverse instead, same for the FuturesChainUniverse