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

c.get_account(12345678,fields=Client.Account.Fields.POSITIONS) not working #280

Closed
Lord-O-Binary opened this issue Nov 15, 2021 · 2 comments

Comments

@Lord-O-Binary
Copy link

Lord-O-Binary commented Nov 15, 2021

Please read the bug submission guidelines before submitting a bug.

Not following guidelines may result in your bug being ignored and/or closed.

Description of Bug

Having changed nothing in my code as of today c.get_accounts(fields=Client.Account.Fields.POSITIONS) no longer returns the positions of the account and instead behaves as if fields=None ie the general account summary is returned.

Code to Reproduce

from tda import auth, client, streaming
from tda.client import Client
import config
try:
self.c = auth.client_from_token_file(config.token_path, config.api_key) #if token not found will execute except block and open webbrowser to login
except FileNotFoundError:
from selenium import webdriver
with webdriver.Chrome(executable_path=config.chrome_path) as driver:
self.c = auth.client_from_login_flow(
driver, config.api_key, config.redirect_uri, config.token_path)

report = agent.c.get_account(12345678,fields=Client.Account.Fields.POSITIONS).json() #replace 12345678 with account number
print(report)

IMPORTANT: Remember to anonymize your code. Be sure to replace API keys/Client IDs with placeholders. Also, never, ever share the contents of your token file.

Expected Behavior
Used to print out all currently held positions

Actual Behavior
Now returns the account summary equivalent to fields=None

Error/Exception Log, If Applicable
NA
See here to learn how to turn on debug logging: https://tda-api.readthedocs.io/en/latest/help.html

@Lord-O-Binary
Copy link
Author

There were no active positions in the account thus it was not being reported. My mistake.

@alexgolec
Copy link
Owner

Issues are not an appropriate venue for support. In the future, please visit our discord to ask the community for help:

https://discord.gg/nfrd9gh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants