go-schwab / trader

⚡ fast unofficial schwab traderapi hook
https://pkg.go.dev/github.com/go-schwab/trader
GNU General Public License v2.0
17 stars 2 forks source link

finish options #2

Open samjtro opened 2 years ago

samjtro commented 2 years ago

Need to decide on a path forward for these sooner rather than later. Functions will either be individually typed (ie func Butterfly() []BUTTERFLY {}) OR grouped (ie func Butterfly() []STRATEGY {}). Need to do research into what the responses will look like from tda in all circumstances. If there are significant differences, individually typed but if not, group it.

samjtro commented 2 years ago

I need to get around to this eventually. I have separated all of the functions from the main file for readability; added benefit is that each file can have a separate Contract type to record data. Makes this much easier

samjtro commented 2 years ago

From the looks of it, it seems that all of the different strategies (besides Analytical) use the same basic return structure. We can utilize a standard UNDERLYING/CONTRACT layout for all of the different strategies.

It is just going to be a question of creating custom structs for certain legs of the different strategies.

samjtro commented 2 years ago

I am about 20% complete with this.

I am going to be using a Standard layout for all spreads, and a custom Interface (potentially struct) with maps of CONTRACTs for certain option calls. Most, however, are fairly straight forward in their returns.