Closed BaconGabe closed 3 years ago
Interesting, what version of the library are you using? If you're not sure, just run the following code:
import td
print(td.__version__)
The version is 0.3.5, which is what installs when using pip
I am getting the same error, what was the solution to this issue. I see that the ticket was closed, it might be useful in knowing the solution for this issue?
This works perfectly fine:
TDSession.get_accounts(account=account_id)
But adding a field like positions returns an error:
TDSession.get_accounts(account=account_id, fields=['positions'])
Error: Traceback (most recent call last): File "C:\Users\Gabe\Desktop\Stock\test.py", line 47, in
print(TDSession.get_accounts(account=account_id, fields=['positions']))
File "C:\Users\Gabe\AppData\Local\Programs\Python\Python39\lib\site-packages\td\client.py", line 1144, in get_accounts
return self._make_request(method='get', endpoint=endpoint, params=params)
File "C:\Users\Gabe\AppData\Local\Programs\Python\Python39\lib\site-packages\td\client.py", line 617, in _make_request
raise NotNulError(message=response.text)
td.exceptions.NotNulError:
{
"error":"the query param being passed is not in the correct format"
}
Process finished with exit code 1
I've tried a lot and even different libraries but have no idea why this is happening. The same command works perfectly fine on the TD Ameritrade website, so why doesn't it work in the library?
print(TDSession.get_accounts(account=account_id, fields=['orders']))
also gives the same error