-
Notifications
You must be signed in to change notification settings - Fork 55
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
Need an example of getting a contract specification for use in a combo options trade #11
Comments
Only way I know of is to download the option chain for that symbol from IB TWS, then you can store the contract IDs accessible by P/C, expiry, and strike. |
What I'm doing is just automating a few trades per week; I could download the whole chain but all I really need is a maximum 4 contracts per trade; no reasonable way to do that? If not would you mind sharing a snippet of your code to download the whole chain? |
The following will download the whole chain for 1 symbol. I never download the whole chain, just the symbol I'm interested in.
I always just download all the expiries for the symbol I'm trading, once every morning. As you can see you can just download a single expiry too. I haven't done this but if you know you only want calls or puts you could add that to the contract specification, probably the same for strikes. |
Thanks!! |
Hi ...
Thanks again for providing this code ... I got the spread example to work last week using it ..
But! I used contractIDs I had gotten through another API ... is there an example somewhere I'm missing?
I would like to be able to do this just using localSymbol, but that doesn't seem to work.
Any guidance on this? Thanks much.
The text was updated successfully, but these errors were encountered: