boyan-soubachov / tastyworks_api

An unofficial, reverse-engineered Python API for tastyworks.
Apache License 2.0
208 stars 79 forks source link

Refactoring + fixes #26

Closed derivatestrader closed 6 years ago

derivatestrader commented 6 years ago

Problem addressed

1) get_all_watchlists returns None 2) warnings that Option is not a Security 3) if option strike is used as Decimal, got error that is_integer is not available 4) type checking: some return types do not correspond to what is actually returned, eg. List[Option] instead of OptionChain 5) example is using hardcoded date, after this date the Option will not be available 6) option DX symbol must be prefixed with '.'

Solution

1) Fixed 2) Option extends Security 3) using decimal % 1 == 0 to determine if it is an integer 4) fixed return types to match al return values 5) using closest third friday 6) option DX symbol is now prefixed with '.' - fixed streamer did not work for my without the dot, it works with the dot.

you also have it in your example.py:

sub_values = {
     "Greeks": [
         ".VIX180718C21",
         ".YUM180518C95"
     ]
}

Checklist

boyan-soubachov commented 6 years ago

Thanks for this!