itsjafer / schwab-api

A python library for placing trades on Charles Schwab
MIT License
201 stars 64 forks source link

Adding option strategies support #49

Closed 4rumprom closed 6 months ago

4rumprom commented 6 months ago

Extending functionalities to enable option trading strategies supported by Schwabs.

Adding to the Schwab class:

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.

4rumprom commented 6 months ago

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.