boyan-soubachov / tastyworks_api

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

Refactoring + fixes #25

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

Checklist

derivatestrader commented 6 years ago

@boyan-soubachov can you please review? thanks

derivatestrader commented 6 years ago

hi,

regarding dxFeed: 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"
     ]
}

I will bump the version

derivatestrader commented 6 years ago

sorry I messed up my branch, I will create new pull request with squashed commits

boyan-soubachov commented 6 years ago

:+1:, thank you; will await the new PR.