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

past and future stock options prices ? #5

Open
ihiasi opened this issue Jun 17, 2020 · 1 comment
Open

past and future stock options prices ? #5

ihiasi opened this issue Jun 17, 2020 · 1 comment

Comments

@ihiasi
Copy link

ihiasi commented Jun 17, 2020

Hi - is it possible to have an example of how would I get past and future stock options prices ? Thank you.

@lbilli
Copy link
Owner

lbilli commented Jun 18, 2020

Just define the appropriate Contract and pass it to reqHistoricalData().
For a stock option something along these lines:

opt = Jib.Contract(symbol="GOOG", secType="OPT", currency="USD", exchange="SMART")
opt.lastTradeDateOrContractMonth = "20200717" # expiration
opt.strike = 1450     # strike price
opt.right = "C"       # call

Check IB docs for more contract examples.
However, keep in mind that, except for forex and commodities, you need a paid subscription to be able to download pretty much any other historical data.

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

No branches or pull requests

2 participants