tradestation-python-api icon indicating copy to clipboard operation
tradestation-python-api copied to clipboard

Authentication not working

Open MonkeymanCoder opened this issue 4 years ago • 1 comments

If I am understanding this correct, the client.py will redirect you to a login page where you will enter user id pwd and pass an access token to the client and this is how authentication will be done. I ran this program and it is not taking me to any web page opening a browser not authenticating. So please let me know if this is a working code or still more work needs to be done.

MonkeymanCoder avatar Jan 29 '21 03:01 MonkeymanCoder

This is what you need to do in order to log in successfully. First follow the updates on issue #2 to the client.py, then add a ts_client.login() to initiate a log in within your code.

if you do this correctly in your text editor/IDE, the output will be a url to paste in your browser, and the response from that url should be pasted back to your text editor/IDE output location.

Hope this helps

from ts.client import TradeStationClient
ts_client = TradeStationClient(
    username="your_id",
    client_id="your_client_id",
    client_secret="your_secret",
    redirect_uri="http://localhost:27353/callback",
    paper_trading="PAPER_TRADING"
    
)
ts_client.login()
a= ts_client.quotes(symbols=['AMZN'])

eyesuk avatar Feb 12 '21 22:02 eyesuk