mcdallas / wallstreet

Real time stock and option data.
MIT License
1.38k stars 203 forks source link

wallstreet does not recognise source argument when using Put() #9

Closed HintikkaKimmo closed 7 years ago

HintikkaKimmo commented 7 years ago

I want to analyze some option chains and data is not available using Google Finance. When I try to use Yahoo finance as a source I get the following error.

from wallstreet import Call, Put, Stock

put_premium = 0.32
underlying = Stock('P')
put_option = Put('P', d=16, m=6, y=2017, strike=8, source='yahoo')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-23-ecc5f3a5a2ce> in <module>()
      1 put_premium = 0.32
      2 underlying = Stock('P')
----> 3 put_option = Put('P', d=16, m=6, y=2017, strike=8, source='yahoo')

TypeError: __init__() got an unexpected keyword argument 'source'

My package version

wallstreet 0.1.5 Python version 3.6.0

mcdallas commented 7 years ago

@HintikkaKimmo That was added in v0.2 which is not up on PyPI yet

HintikkaKimmo commented 7 years ago

Ah sorry. Forgot to close the issue noticed the same looking at the build it docs. What is the strick parameter in there anyway? Don't use alternative option chain if exact match is not found?

mcdallas commented 7 years ago

@HintikkaKimmo Exactly. If you pass strict=True it won't use the closest expiration/strike if there is no match. You will get an Exception instead