Set Up Instructions

1) Install SwingTraderStockBot via setup file.

2) Enable developer apps by Creating a Developer Account here: https://developer.tdameritrade.com/content/getting-started. Direct link is here: https://developer.tdameritrade.com/user/register

3) Once you confirm your email, you need go here: https://developer.tdameritrade.com/ and click on login and login using the account you created.

4) Once logged in go here: https://developer.tdameritrade.com/user/me/apps/add , put any name for the App and for callback URL put: http://localhost , for purpose you can put trade stocks, for order limit enter 60 and hit create app.

5) Now that the app is created go here to get your “Consumer Key” for the app by clicking on the app name link: https://developer.tdameritrade.com/user/me/apps

6) Write down your consumer key in a safe location, we will be referring to this as your “Client ID” for the app going forward.

7) Go to the custom URL here by replacing ClientID with your client ID you obtained above into the link: https://auth.tdameritrade.com/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost&client_id=ClientID%40AMER.OAUTHAP
The url should be changed to go from client_id=ClientID to client_id=whateveryourclientidishere (do not modify anything else in the rest of the link that appears before or after this)

8) Once you are on this page you should log in using your TD Ameritrade trading account information.

9) This will then take you to a blank page with a special URL you need to grab from the URL address bar, copy ALL of the text that appears AFTER code=

10) Go to https://www.urldecoder.org/ and paste this into the top box then hit decode at the bottom, on the bottom box you should see the decoded text which we will need for the following steps.

11) Go to the following URL https://developer.tdameritrade.com/authentication/apis/post/token-0 and enter the values below as follows:
grant_type authorization_code
refresh_token (LEAVE BLANK)
access_type offline
code (ENTER URL DECODED CODE VARIABLE OBTAINED ABOVE at end of step 10)
client_id (this is from the client id we obtained from the end of step 6 above)
redirect_url http://localhost

12) Hit the send button at the bottom of the page, you should see “OK” response appear and below that you will see your Refresh Token (copy this and save it in a safe location)!

13) Start the bot exe file and enter the following variables:
Account ID (this is your official TD account ID number found on the TD website)
Client ID (this is the code you obtained at the end of step 6 above)
Refresh Code (this is the Refresh Token obtained at end of step 12)

14) Enter the stock you want to trade and any options below (see options help guide for more information at https://stsbot.com/botguide.html)

STSBot.com