Skip to content

Incorrect Option Universe DataFrame Index #8331

Description

@AlexCatarino

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions