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

Start collecting open interest data? #1341

Open
VMatthijs opened this issue Feb 21, 2024 · 1 comment
Open

Start collecting open interest data? #1341

VMatthijs opened this issue Feb 21, 2024 · 1 comment

Comments

@VMatthijs
Copy link
Contributor

VMatthijs commented Feb 21, 2024

An idea for a potential new feature: collecting open interest data. IB provides it, so it shouldn't be hard at all. Example code:

from ib_insync import *

util.startLoop()
ib = IB()
ib.connect('127.0.0.1', 4001, clientId=666)

ib.reqMarketDataType(3)
contract = Future('R','202403', 'ICEEU')
ticker = ib.reqMktData(contract, '588', False, False, None)
while True:
    ib.sleep(1)
    print(ticker.futuresOpenInterest)

Historical open interest data is also provided by Barchart so it shouldn't be difficult to backfill it.

I can imagine that this data might be relevant for considerations of whether or not to trade a market, and that it could be used as an input to certain trading signals. If you think it would be useful, @robcarver17 , I'm happy to implement it.

@robcarver17
Copy link
Owner

Sure could be useful. For implementation, please go slowly adding the required classes bottom up* one PR at a time and ensuring existing framework is respected. Any questions just ask.

  • top down would require a big bang PR, this way you can just add unused code safely.

[apologies if telling anyone how to suck eggs here]

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

No branches or pull requests

2 participants