TOS (Think or Swim) API

I've seen a few other packages leverage the thinkorswim API as an intraday data source. What's nice about them is that I was able to open a free account with free data just for depositing some money in an account (even though I mostly trade through IB).

I tried using DDE with the account but there is no backfill so it isn't that useful.

Tomasz, I know you have a lot on your plate and doing a DLL for them is probably not a priority. I don't know the technology behind a data DLL that well. Would it be possible for me or a small group of Amibroker users to hire someone to write a DLL to access their data just like the iqfeed works... or is it something that has to be done by someone inside of AmiBroker?


No it does not to be done inside AmiBroker. All plugins are separate from program itself. AmiBroker Development Kit (ADK) is open and freely available from download page without any "secrets" and it contains examples on data plugins. IQFeed, eSignal, Interactive Brokers use the very same ADK to provide all data features for those sources.

1 Like

Hi Mike,
I would be willing to pitch on paying someone to making a data and trading dll for the new TD Ameritrade API. (TD Ameritrade == Think or Swim)

That being said, this person should be from the AMI user group with a registered copy of AMI broker. I have paid someone in the past to make a data plugin for me, and it was completely broken. I paid for the persons time, but lesson learned. Don't expect any old C programmer to make a trading related plugin. :laughing:

So... Any takers out there?

@Pinecone have you reviewed this thread with a list of possible help?

As well, I would suggest you contact a couple of the most knowledgeable users/coders in the AmiBroker world, @fxshrat and @aron (and I know both are very busy and i hope they forgive me for mentioning them but they are excellent) IMHO though they do not market their services they are outstanding programmers .

I suspect what you are asking is a big job and will not be inexpensive to create a well functioning user friendly version. I don't use TD Ameritrade so have nothing more to contribute.

Good luck, let me know via PM how it goes.

I would really like to see this plugin built. I see that Medved trader allows a datastream from td ameritrade / thinkorswim so i know it's possible. And I thought about hiring someone to do it but I reached out to them (td ameritrade) and they told me they only provide individual users the API access for a minimum account size. I mostly use interactive brokers for trading so my ameritrade account is not large enough. I'm guessing if medved did it then he did some sort of deal or formed some sort of relationship directly so I think that is the tricky part. While I think we could hire a 3rd party... I think AmiBroker or some 3rd party would need to step up and create a relationship providing access to the data.

At this point building anything for TD API is a very big risk as the future of it is pretty much unknown (you can google for Ameritrade and QuoteTracker history).

We are only keen to use data APIs that
a) have wide international coverage (not US only)
b) are independent from your trading account
c) don't cost a fortune monthly
d) have open API

I was given access to the api with a very small account ( < $5k). I think they granted it because I use the account for leveraged intraday forex and have a very large volume trade history. I recently moved the account to IB for their improved spread, but found that they do not offer leverage. So back to TDA for me.

@Tomasz what you say makes sense. Your product is international, and I can see why you would like to remain focused on that aspect.

@portfoliobuilder Thank you for your input. Hopefully we can find someone who can work on it. If not I guess I will be left to tinker with it. C and API's are not my strong suite, that's for sure.

I found this on reddit last night. Maybe it will help someone to get the API to work.

successful access to TD ameritrade API
Step 1 Register

Step 2 Go to my Apps and create an App

step 3 Give a name and user id and set the Callback URL to a http :// localhost and a description

Step 4 get an Authorization code

Step 5 to get the code open a new tab and put this http with your local host and user id

r/ your local host &client_id= use your app user name

Step 6 Authorize the link to your TD trading Account username and password

Step 7 go to the link and it will give you a unable to connect 404 page , but , copy the http part that comes after “code=” in the http address it is a long series of numbers and letters

copy the address to a note pad

Step 8 google URL decode and decode

Step 9 copy the code and URL decode the code and keep this new code

step 10 Get the Access Token here

Step 11 Fill the Access Token information

grant_type: authorization_code

access_type: offline

code = the URL CODE you copied and decoded goes here

client_id = your td dev app user id

redirect_uri = you local host

Step 12 Press send and get the token code will be in the response tab at the bottom

"access_token": " Your token code is here "

Copy all info on a note pad

Step 13 Go to the TD developer quotes API and paste the Token Code in Authorization

Symbol = AAPL

Authorization = the token code you requested from Post Access Token

Step 14 Authenticate in the little box bottom left corner with your TD trading account username and password

Step 15 you are now able to get real time data request from TD API