QuantConnect / QuantConnect/Lean
Configurable Rolling Date With DataMappingMode
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 21.7k
- Forks
- 5.3k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 34
Description
Expected Behavior
We can configure the behavior of DataMappingMode.LastTradingDate to roll the contract x days before. Also, restrict the contracts to the selected few. For example, Gold listed months include Feb, Apr, Jun, Aug, Oct, Dec, but Oct historically has weak open interest. Most systematic traders only hold Feb, Apr, Jun, Aug, Dec.
Actual Behavior
We are locked to the LastTradingDate, and most brokers, such as Interactive Brokers or TradeStation, will force liquidate physically settled futures many days prior to expiry during live trading.
Potential Solution
N/A
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing DataMappingMode.LastTradingDate handling and the contract-mapping path it uses. Determine where configurable pre-expiry rolling and eligible contract months belong, then add coverage for the selected-month behavior and broker-driven early liquidation scenario. Done means both the roll offset and restricted contract set can be configured without changing existing defaults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- fintech-quant
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100