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

Open Interest History Requests Don't Drop Weekends #8632

Open
4 tasks done
DerekMelchin opened this issue Mar 14, 2025 · 2 comments · May be fixed by #8662
Open
4 tasks done

Open Interest History Requests Don't Drop Weekends #8632

DerekMelchin opened this issue Mar 14, 2025 · 2 comments · May be fixed by #8662
Assignees
Labels

Comments

@DerekMelchin
Copy link
Collaborator

Expected Behavior

When we request 5 daily open interest values for a contract, the history request returns 5 data points.

Actual Behavior

The history request returns 5 data points, plus days when the market was closed.

self = QuantBook()
self.set_start_date(2024, 12, 19)
equity = self.add_equity("SPY", data_normalization_mode=DataNormalizationMode.RAW)
symbol = sorted(self.option_chain(equity.symbol), key=lambda c: c.open_interest)[-1].symbol
history = self.history(OpenInterest, symbol, 5, Resolution.DAILY)
history

Image

TradeBar history requests work as expected.

Image

Potential Solution

N/A

Reproducing the Problem

Run code snippet above

System Information

QC Cloud

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
@DerekMelchin
Copy link
Collaborator Author

With Futures, I get 7 data points, where 6 of them are unique.

self = QuantBook()
self.set_start_date(2024, 12, 19)
future = self.add_future(Futures.Indices.SP_500_E_MINI)
contract_symbols = self.future_chain_provider.get_future_contract_list(future.symbol, self.time)
symbol = sorted(contract_symbols, key=lambda symbol: symbol.id.date)[0]
history = self.history(OpenInterest, symbol, 5, Resolution.DAILY)
history

Image

@Martin-Molinero
Copy link
Member

Open Interest is expected to arrive outside of market hours so we are using an always open exchange, but for fill forwarding we might use regular market hours instead 👍

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.

3 participants