Skip to content

Fix Interactive Brokers options chain issue #2711

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

Merged

Conversation

FGU1
Copy link
Contributor

@FGU1 FGU1 commented Jun 13, 2025

Pull Request

NautilusTrader prioritizes correctness and reliability, please follow existing patterns for validation and testing.

Summary

Added optional "options_chain_exchange" parameter to IBcontract. Change option chain request to use this new parameter as exchange for options, if this parameter is not set will use underlying's exchange.
This allow using a different exchange than the underlying's, be it "SMART" or others.
ib doc updated accordingly

Related Issues/PRs

Close issue #2622

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • [X ] Breaking change (impacts existing behavior)
  • [X ] Documentation update
  • Maintenance / chore

Breaking change details (if applicable)

Before : by default for US markets, "SMART" was applied as exchange for options. Use of ANY other exchange, including US ones was impossible
Now : Those who wish "SMART" exchange, or an exchange different from the underlying's have to specify it with options_chain_exchange parameter. Use of the underlying's exchange is now functional and automatically done just by not using this parameter.

Release notes

  • I added a concise entry to RELEASES.md that follows the existing conventions (when applicable)

Testing

Ensure new or changed logic is covered by tests.

  • Affected code paths are already covered by the test suite
  • I added/updated tests to cover new or changed logic

unit tests for usual IBcontract (excluding options chain)
used MRE in #2622 and modified it to check various exchanges.

@cjdsellers cjdsellers changed the title fix Interactive Brokers options chain issue #2622 Fix Interactive Brokers options chain issue Jun 13, 2025
@cjdsellers cjdsellers merged commit 93a0f12 into nautechsystems:develop Jun 13, 2025
13 checks passed
@cjdsellers
Copy link
Member

Hi @FGU1

Many thanks for the fix! 🙏

stastnypremysl pushed a commit to stastnypremysl/nautilus_trader that referenced this pull request Jun 16, 2025
@kadyrleev
Copy link

Hey @FGU1 , thanks for the fix!

I wonder whether it's even possible for underlying to have a different exchange than its options? It might be then enough to pass in the contact.exchange as an argument for exchange parameter in get_option_chain_details_by_expiry and get_option_chain_details_by_range method calls. What do you think?

@FGU1
Copy link
Contributor Author

FGU1 commented Jun 18, 2025

Hi @kadyrleev, yes an option can be traded on an exchange different from its underlying. Hence the possibility to specify it using optional parameter : "options_chain_exchange".

@kadyrleev
Copy link

Hi @kadyrleev, yes an option can be traded on an exchange different from its underlying. Hence the possibility to specify it using optional parameter : "options_chain_exchange".

Thanks, @FGU1! I didn't know that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants