tdameritrade | Trading stocks with the TD Ameritrade API and Python | Business library

 by   hackingthemarkets Python Version: Current License: No License

kandi X-RAY | tdameritrade Summary

kandi X-RAY | tdameritrade Summary

tdameritrade is a Python library typically used in Web Site, Business applications. tdameritrade has no bugs, it has no vulnerabilities, it has build file available and it has low support. You can download it from GitHub.

TD Ameritrade API examples for obtaining fundamental data, option chains, and placing orders.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tdameritrade has a low active ecosystem.
              It has 26 star(s) with 18 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 2 open issues and 0 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of tdameritrade is current.

            kandi-Quality Quality

              tdameritrade has no bugs reported.

            kandi-Security Security

              tdameritrade has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              tdameritrade does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              tdameritrade releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tdameritrade
            Get all kandi verified functions for this library.

            tdameritrade Key Features

            No Key Features are available at this moment for tdameritrade.

            tdameritrade Examples and Code Snippets

            No Code Snippets are available at this moment for tdameritrade.

            Community Discussions

            QUESTION

            retrieve value from a dictionary inside a list, inside a dictionary
            Asked 2021-May-11 at 05:02

            I am trying to return the most recent "low" and "high" values into variables and am not sure how to retrieve them.

            The code I am running is:

            ...

            ANSWER

            Answered 2021-May-11 at 04:44

            QUESTION

            Rust: View entire Command::New command arguement structs as its passed to terminal / correct my arguements
            Asked 2021-Mar-18 at 01:14

            I am not getting the correct response from the server running the following

            ...

            ANSWER

            Answered 2021-Mar-18 at 01:14

            For reasons unknown... changing the --header switch / flag to -H solved the problem. As shown in the following. Spoke with a friend and apparently the shortened form may take different parameters.

            Source https://stackoverflow.com/questions/66667515

            QUESTION

            C# Iterate from Last JSON Object to First
            Asked 2021-Feb-25 at 03:21

            Is there a good way to iterate through a deserialized JSON object from last to first? i.e., the following code I can iterate and record 'n' values from first to last until it meets my count condition for further processing:

            ...

            ANSWER

            Answered 2021-Feb-25 at 03:21

            You can use the Reverse() method of the JArray class. Just cast your history["candles"] JTokeninto a JArray, and call reverse.

            Source https://stackoverflow.com/questions/66360220

            QUESTION

            JSON response is in one line and need to convert to a Dataframe
            Asked 2021-Feb-17 at 07:47

            Using TDAmeritrade API.

            I made the request like this:

            ...

            ANSWER

            Answered 2021-Feb-17 at 07:47

            The problem is your data is not in record_path="symbol", it's nested inside callExpDateMap

            You have to create a new array and iterate through callExpDateMap and its child json to get the array

            Source https://stackoverflow.com/questions/66235222

            QUESTION

            Is refreshing the OAuth refresh token standard behavior?
            Asked 2021-Feb-11 at 16:21

            I'm implementing an API wrapper for an OAuth API (in particular, TD Ameritrade) and I've encountered an interesting piece of functionality. Unlike most OAuth implementations I've seen, in which refresh token is valid for some time period and then the user has to re-authenticate, this API supports refreshing the refresh token itself.

            In particular, if you send a request with the following format to the authentication endpoint, you will be rewarded with a brand new refresh token that's good for 90 days:

            ...

            ANSWER

            Answered 2021-Feb-11 at 16:21

            The access_type: offline parameter is not a standard in OAuth, but it's used e.g. by Google in their token endpoint request - you must pass it to get a refresh token.

            On the other refreshing refresh tokens is part of the OAuth standard. The RFC 6749 states that in a response to the token endpoint:

            The authorization server MAY issue a new refresh token, in which case the client MUST discard the old refresh token and replace it with the new refresh token. The authorization server MAY revoke the old refresh token after issuing a new refresh token to the client. If a new refresh token is issued, the refresh token scope MUST be identical to that of the refresh token included by the client in the request.

            So it is part of the standard to refresh refresh tokens, but it should be done differently than in their API.

            Source https://stackoverflow.com/questions/66138747

            QUESTION

            How can I parse some JSON dynamically without knowing JSON values?
            Asked 2021-Feb-08 at 20:57

            So I am using TDAmeritrade API to receive stock data with a C# Winforms program on Visual Studio. It takes the user input stock symbol and searches for the info. I am using HttpClient and Newtonsoft.Json and have been able to successfully perform the GET request and receive a JSON string back, but I do not know how to get all of the information I need out of it.

            Here is the JSON: https://drive.google.com/file/d/1TpAUwjyqrHArEXGXMof_K1eQe0hFoaw5/view?usp=sharing

            Above is the JSON string sent back to me then formatted. My goal is to record information for each price in "callExpDateMap.2021-02-19:11" and "callExpDateMap.2021-03-19:39". The problem is that for each different stock, the dates that show up in "callExpDateMap" are going to be different.

            ...

            ANSWER

            Answered 2021-Feb-08 at 20:57

            This is official documentation of Newtonsoft method you are trying to use.

            https://www.newtonsoft.com/json/help/html/Overload_Newtonsoft_Json_JsonConvert_DeserializeObject.htm

            If an API's method returns different json propeties and you cannot trust it's property names all the times, then you can try using a deserialize method that returns .Net object, for example: JsonConvert.DeserializeObject Method (String) https://www.newtonsoft.com/json/help/html/M_Newtonsoft_Json_JsonConvert_DeserializeObject.htm

            That method's signature is this: public static Object DeserializeObject(string value)

            Parameter is: value of type json string.

            Return Value is: Object of type object.

            If you do not want an Object, then you can of course use a .Net type you have. Such as this method: JsonConvert.DeserializeObject Method (String)

            Any property that you have in both (the .net type and json object) will get populated. If .net type has properties that do not exist in json object, then those will be ignored. If json object has properties that do not exist in.net, then those will be ignored too.

            Here's an example of a .Net type

            Source https://stackoverflow.com/questions/66106915

            QUESTION

            ASP.NET Pass Variable to JSON Deserialized HTTP Response Object
            Asked 2021-Feb-07 at 21:27

            Is there a good way to dynamically pass a string variable in place of a deserialized object definition? How I mean, is that the code snippet below is proper syntax to deserialize the JSON response object in order to store the returned data types in a database for further processing.

            ...

            ANSWER

            Answered 2021-Feb-07 at 21:27

            You can deserialize to JObject which has indexer to perform such dynamic querying:

            Source https://stackoverflow.com/questions/66093178

            QUESTION

            TD Ameritrade API :: Unable to connect Firefox can’t establish a connection to the server at 127.0.0.1
            Asked 2020-Dec-25 at 01:08

            Using documentation from https://pypi.org/project/td-ameritrade-python-api/

            I'm trying to get started with the TD Ameritrade API in Python...

            The problem I am having is with authentication of my account which is done via this Url: (note: client_id has been changed b/c it is private)

            https://auth.tdameritrade.com/auth/?response_type=code&redirect_uri=https%3A%2F%2F127.0.0.1&client_id=[Private]%40AMER.OAUTHAP

            So everything works:

            1. I get the login screen
            2. After successful login, I get the permissions page

            EXCEPT...

            When everything is completed I get this error from FireFox (or Chrome, whatever)

            Unable to connect

            Firefox can’t establish a connection to the server at 127.0.0.1.

            Given the above issue, I search Google for info and did the following:

            1. Cleared Cache
            2. Made sure correct IIS settings were configured

            It does not work at this point.

            I have no idea what is going on. Any help would be greatly appreciated.

            ...

            ANSWER

            Answered 2020-Dec-14 at 06:08

            This is probably one of the few times when getting an error message like you did is actually part of the process to authenticate your account. At the very bottom of the PyPi page for that library he explains that you're supposed to copy and paste the resulting url of the error page you're currently on into your terminal. It was confusing for me aswell and it took me awhile to really understand what's going on so I will explain it as best as I can.

            Alex Reed is the guy who made the library TD Ameritrade API and he has an awesome YouTube channel called Sigma Coding. One of his video series guides you through the whole process of directly connecting to the TD Ameritrade API without the use of his API library, and another series about building the library itself.

            In this video How to Use the TD Ameritrade API | Part 2 he is demonstrating how to access the API. The link should have a time stamp of 16:36 if not skip ahead to that section and you will see a similar error to what you are experiencing except he is using Chrome, not Firefox so the error is the same but worded differently.

            Here's a picture to better explain the rest:

            What he does next is copy and paste the current url of the page with the error, which contains the code needed for the next step. The url in the picture starts with https://localhost/test?code=siVrfqPLdQ... and you can see that the url has code= following a very long access code that TD Ameritrade needs to generate your access token.

            Your url should have a similar structure, don't worry if it doesn't have /test after localhost, he made a specific folder for the video series. Just copy and paste the whole thing in your terminal where you should have a line that says:

            Paste the full redirect url here:

            Source https://stackoverflow.com/questions/64081713

            QUESTION

            Does anyone know how to get the hours for markets such as the NYSE on TD Ameritrade API?
            Asked 2020-Dec-23 at 06:37

            I'm trying to request hour information from the TD Ameritrade API. Is there any way I could get the hours for the New York Stock Exchange?

            Here is the link to the API: https://developer.tdameritrade.com/

            ...

            ANSWER

            Answered 2020-Dec-23 at 06:37

            TD Ameritrade's API provides an endpoint for market hours however you can't specify which exchange to check, only which market (BOND, EQUITY, ETF etc..).

            For some reason, it allows you to specify which date but it only accepts the current date. Providing an access token doesn't do anything so I won't be including a header with the token in my example.

            Source https://stackoverflow.com/questions/65399144

            QUESTION

            AWS EC2 times out when trying to authenticate using a selenium headless chrome
            Asked 2020-Nov-18 at 22:38

            I'm trying to use AWS to automate some procedures, and need to authenticate myself with the API I'm using. The issue is, its way too slow. I'm using a selenium headless chrome browser to connect to the page, fill in the information I need and submit the form (according to other sources I found the TD Ameritrade API only accepts the browser route so there is no way to do it just with requests, if you know otherwise that would be great too). Finding the element on the page takes about 20 seconds, sending the keys maybe a full minute, and trying to submit the form it times out after 5 minutes. Is this an issue with my implementation of selenium, or is it something to do with AWS or the API I'm connecting to? My code is as shown below and the error:

            ...

            ANSWER

            Answered 2020-Nov-18 at 22:38

            A bit of more details about your usecase would have helped us to analyze the reason behind the program executing too slow. Here are a few considerations:

            • A common cause for Chrome to crash during startup is running Chrome as root user (administrator) on Linux. While it is possible to work around this issue by passing --no-sandbox flag when creating your WebDriver session, such a configuration is unsupported and highly discouraged. You need to configure your environment to run Chrome as a regular user instead. So you may need to drop the --no-sandbox option.

            Here is the link to the Sandbox story.

            • While using --headless option you won't be able to use --window-size=1280x1696 due to certain constraints.

            You can find a couple of relevant detailed discussion in:

            You can find a relevant detailed discussion in ERROR:gpu_process_transport_factory.cc(1007)-Lost UI shared context : while initializing Chrome browser through ChromeDriver in Headless mode

            • Further you haven't mentioned any specific requirement of using --hide-scrollbars, --enable-logging, --log-level=0, --v=99, --single-process, --data-path=tmp/data-path, --homedir=tmp, --disk-cache-dir=tmp/cache-dir, --no-proxy-server, --proxy-server='direct://' and --proxy-bypass-list=* arguments which you opt to drop for the time being and add them back as per your Test Specification.
            References

            You can find a couple of relevant detailed discussions in:

            Source https://stackoverflow.com/questions/64793958

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tdameritrade

            You can download it from GitHub.
            You can use tdameritrade like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/hackingthemarkets/tdameritrade.git

          • CLI

            gh repo clone hackingthemarkets/tdameritrade

          • sshUrl

            git@github.com:hackingthemarkets/tdameritrade.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Business Libraries

            tushare

            by waditu

            yfinance

            by ranaroussi

            invoiceninja

            by invoiceninja

            ta-lib

            by mrjbq7

            Manta

            by hql287

            Try Top Libraries by hackingthemarkets

            binance-tutorials

            by hackingthemarketsPython

            tradekit

            by hackingthemarketsHTML

            candlestick-screener

            by hackingthemarketsPython

            supertrend-crypto-bot

            by hackingthemarketsPython