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

get_orders_by_path returns empty list #205

Closed
ivnle opened this issue Mar 26, 2021 · 2 comments · Fixed by #248
Closed

get_orders_by_path returns empty list #205

ivnle opened this issue Mar 26, 2021 · 2 comments · Fixed by #248

Comments

@ivnle
Copy link

ivnle commented Mar 26, 2021

Description of Bug
get_orders_by_path is returning an empty list [] instead of a list of my orders. If I use the tool on TDA's page for this function, it successfully returns my orders. I'm also able to use get_account with the ORDERS field to return my orders.

Code to Reproduce

from tda import auth, client
import json
import config

try:
    c = auth.client_from_token_file(config.token_path, config.api_key)
except FileNotFoundError:
    from selenium import webdriver
    with webdriver.Chrome(executable_path='/home/user/chromedriver') as driver:
        c = auth.client_from_login_flow(
            driver, config.api_key, config.redirect_uri, config.token_path)

def getOrders(client):
    r = client.get_orders_by_path(config.account_id)
    return r.json()

r = getPutOrders(client=c)
print(json.dumps(r, indent=4))

Expected Behavior
Return a list populated with my orders.

Actual Behavior
Returns an empty list.

Error/Exception Log, If Applicable
N/A

@ivnle ivnle changed the title get_orders_by_path returns empty list get_orders_by_path returns empty list Mar 26, 2021
@ivnle
Copy link
Author

ivnle commented Apr 1, 2021

For anyone else with the same issue, a temporary work around is to use c.get_order("", config.account_id). This is equivalent to using the Get Orders By Path endpoint.

@alexgolec alexgolec reopened this May 8, 2021
@alexgolec
Copy link
Owner

Are you still getting this issue? I attempted to replicate and got plenty of orders.

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

Successfully merging a pull request may close this issue.

2 participants