Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iteration over 0-d array upon passing interestRate #89

Open
anishzute opened this issue May 13, 2020 · 0 comments
Open

Iteration over 0-d array upon passing interestRate #89

anishzute opened this issue May 13, 2020 · 0 comments
Labels
backlog Issues that haven't been categorized or are not yet ready for work bug Concrete, reproducible bugs

Comments

@anishzute
Copy link

If I attempt to call the optionsDF() or options() functions for an analytical query with the parameter interestRate = somefloat, it fails with TypeError: iteration over a 0-d array. If I comment out only the interestRate parameter, it runs flawlessly. The full code is below with the Traceback.

        option = tdc.optionsDF(strategy='ANALYTICAL',
                               symbol='SPY',
                               contractType='CALL'
                               strike=140,
                               fromDate='2020-05-20',
                               toDate='2020-05-21',
                               volatility=200,
                               underlyingPrice=240,
                               interestRate=0.1433,
                               daysToExpiration=5
                               )
File "...python3.7/site-packages/tdameritrade/client.py", line 405, in optionsDF
    optionType=optionType)
  File "...python3.7/site-packages/tdameritrade/client.py", line 369, in options
    return self._request(GET_OPTION_CHAIN, params=params).json()
  File "...python3.7/site-packages/tdameritrade/client.py", line 84, in _request
    resp = self.session.request(method, url, params=params, *args, **kwargs)
  File "...python3.7/site-packages/tdameritrade/session.py", line 22, in request
    return super().request(headers=self._headers, *args, **kwargs)
  File "...python3.7/site-packages/requests/sessions.py", line 516, in request
    prep = self.prepare_request(req)
  File "...python3.7/site-packages/requests/sessions.py", line 459, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "...python3.7/site-packages/requests/models.py", line 314, in prepare
    self.prepare_url(url, params)
  File "...python3.7/site-packages/requests/models.py", line 432, in prepare_url
    enc_params = self._encode_params(params)
  File "...python3.7/site-packages/requests/models.py", line 100, in _encode_params
    for v in vs:
TypeError: iteration over a 0-d array
@timkpaine timkpaine added backlog Issues that haven't been categorized or are not yet ready for work bug Concrete, reproducible bugs labels Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issues that haven't been categorized or are not yet ready for work bug Concrete, reproducible bugs
Projects
None yet
Development

No branches or pull requests

2 participants