QuantConnect / QuantConnect/Lean

Include Options to Universe When They are First Issued

Open
#8,329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
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 master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.