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

Adding option strategies support #49

Merged
merged 33 commits into from
Mar 5, 2024
Merged

Adding option strategies support #49

merged 33 commits into from
Mar 5, 2024

Conversation

4rumprom
Copy link
Contributor

@4rumprom 4rumprom commented Feb 24, 2024

Extending functionalities to enable option trading strategies supported by Schwabs.

Adding to the Schwab class:

  • API call function to pull option chain quotes for an underlying symbol. This optionally includes option greeks.
  • Specific option trading function to create 2 to 4 legged strategies such as spreads, butterflies, condors etc.

Also included an example file that pulls the option chains, helps normalize the json response into a pandas dataframe and creates a dry run on an option straddle strategy.

Copy link
Owner

@itsjafer itsjafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the contribution! I left a few nitpick comments!

schwab_api/schwab.py Outdated Show resolved Hide resolved
example/example_options.py Outdated Show resolved Hide resolved
example/example_options.py Outdated Show resolved Hide resolved
schwab_api/schwab.py Show resolved Hide resolved
@4rumprom
Copy link
Contributor Author

4rumprom commented Mar 4, 2024

I made the requested changes.

I like the idea of class-wide enumerators for the different option strategies or order types. I'm not totally sure on the best approach. I'd like to get the current pull request approved as is for now. It's probably only one of more pull requests to come.

With options, I have a big question mark around handling option assignments before expiration. I saw that account positions have child positions. I wonder if that's where those will be referenced at. I hate that Schwab doesn't come with a paper trading account to figure this out.

@itsjafer itsjafer merged commit 8b011a2 into itsjafer:main Mar 5, 2024
1 check passed
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.

2 participants