QuantConnect / QuantConnect/Lean
Include Options to Universe When They are First Issued
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
Be able to trade an option contract as soon as they are available (T+0)
Actual Behavior
We can only trade options on T+1 because the universe is created with EOD data.
Potential Solution
Add contracts that contracts with zero prices. They will only have the Symbol so that we can select them as before.
Reproducing the Problem
qb = QuantBook()
equity_symbol = qb.add_equity("QQQ", data_normalization_mode=DataNormalizationMode.RAW).symbol
option = qb.add_option(equity_symbol)
t_date = datetime(2013, 9, 27)
contract_symbols = qb.option_chain_provider.get_option_contract_list(equity_symbol, start_date)
[s.id.strike_price for s in contract_symbols
if s.id.option_right == OptionRight.PUT
and s.id.strike_price == 75.5
and s.id.date == datetime(2013, 10, 11)]
The list is empty because SPY 131011P00075500 started trading on 20130927.
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
- I have provided detailed steps to reproduce the issue
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 with the QuantBook option_chain_provider.get_option_contract_list entry point and reproduce the empty result for the 2013-09-27 option chain using the provided Python example. Trace how add_option obtains the universe and handles newly issued contracts, then verify that the specified zero-price contract is available on its first trading date.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100