Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Option Universe DataFrame Index #8331

Closed
4 tasks done
AlexCatarino opened this issue Sep 18, 2024 · 0 comments · Fixed by #8334
Closed
4 tasks done

Incorrect Option Universe DataFrame Index #8331

AlexCatarino opened this issue Sep 18, 2024 · 0 comments · Fixed by #8334
Assignees
Labels

Comments

@AlexCatarino
Copy link
Member

Expected Behavior

The index of Option Universe is Symbol/Time.

Actual Behavior

All the Symbols are the same for a given time:

Potential Solution

Review how Symbol is acquired.. it should come from a Data member.

Reproducing the Problem

self = QuantBook()
self.set_start_date(2020, 1, 1)
underlying = self.add_equity("SPY", data_normalization_mode=DataNormalizationMode.RAW).symbol
option_chain = self.option_chain(underlying).data_frame
print(option_chain.index.get_level_values('symbol').drop_duplicates())
print(option_chain.shape)

Logs:

Index(['SPY XFH59UO5PUUE|SPY R735QTJ8XC9X'], dtype='object', name='symbol')
(6964, 12)
It should have 6964 indices after we call drop_duplicates.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants