Closed jaredbroad closed 6 years ago
I had a quick look at https://github.com/kriasoft/TDAmeritrade and it looks like it lacks make order implementation. If the order fills are via REST it may be a pain.
Was trying to find some api docs then came across this ...and am not sure they even let you see the API doc unless you're willing to pony up.
Obtaining access to TD Ameritrade API has some hefty requirements. I believe TD Ameritrade requires a minimum account balance ($150k+). I doubt most users will have an easy time getting access to the API. Been using Lean for quite some time now, just joined GitHub so that I can give back a little bit since I've been using your engine.
@pnguyen30 - Great point thank you. I assumed they'd let LEAN connect as an organization and hopefully give all its users access under the same banner.
What should be the next major brokerage we connect with?
There has been quite a bit of hype with Robinhood lately, but there seem to be quite a few restrictions on how often one can buy/sell with them, so I'm not too keen on Robinhood integration. If TD Ameritrade doesn't work out, Perhaps E-Trade might be a great brokerage to integrate with.
I cannot recommend Robinhood for QuantConnect.
I have a Robinhood account.
Good to know thanks @bizcad
Hi Jared,
I just came across this blog and wanted to let you know that I have C# code for TD Ameritrade API for orders, L1 quotes, history, news, etc. It would be great to have a native data feed for QuantConnect. I've attached the API docs and am happy to share the code with you if you're interested. Let me know if I can help build a data connector. Since I just joined QC, I'm still getting familiar with the architecture and would need a tutorial on QC iBrokerage or I could help test since I have a live account. Attached is the API documentation, which is in an old windows help file format.
Thanks Brad Gessner QC Newbie TDA-API.zip
Awesome! Welcome @BradGessner! :) TD seems to have very high minimums to use the API putting out out of the reach of individuals, but would be helpful for hedgefunds. I'd be happy to help you implement an IBrokerage + IDataQueueHandler -- shoot me an email jared@quantconnect.com and we can setup a time to chat.
Hi @BradGessner, I have a mostly complete IBrokerage integration waiting in the wings and a second in the pipeline. Would be great to share stories and advice on this.
Jared,
Please see http://apiforums.tdameritrade.com/tda-board/ubbthreads.php?ubb=newuser
The requirements for using the TD API are:
(a) your Account value is not less than $500,000; and/or (b) you place at least 30 trades per quarter through your Account.
If at any time you no longer meet these requirements, you may be denied access to API.
Quantopian has Robinhood and I think it'd be really exciting if QuantConnect did!
There may be an easier way to do this: do a FIX connector. There are a number of open-source FIX libraries of code out there. You also don't need to implement all of it.
FIX is to my eyes ugly, but it's quite standardized and many of the FOREX companies offer FIX feeds with not too high minimum accounts (~10k$).
In practice, each company's FIX feed may need some tweaking, but it would be relatively minor so with one programming effort you might get a number of partners.
Thanks for the suggestion @kenfehling! I tend to agree with @OpenTrading; a fix connector should be the next implementation to unlock many others.
One of the main retail forex platforms has rolled out a FIX API for ALL accounts: https://smnweekly.com/2016/08/02/spotware-adds-fix-api-ecn-forex-platform-ctrader/ https://help.spotware.com/FIX
It looks like the implementation is still a little incomplete and/or buggy https://ctdn.com/forum/fix-api
but they're rapidly improving it.
This would add a huge number of eligible accounts, with effectively no minimum account balance.
Hi guys, just a quick note on FIX. While it is a standard in the industry, many implementations are slightly different and not always fully compatible. Generally, we cannot expect a broker to use particular FIX implementation to be compatible with us. So it makes sense for us to initially design a support for multiple different FIX connectors in the system. It also makes sense to contact our supported (or planned) brokers with question on FIX implementation they use before coding the stuff. At least, this is the approach that one of BBBs has taken to hedge the risks. Thank you, Pavel
Yes the implementation details are often frustratingly different, but once you have done one, you have a good starting point for others. I thought spotware would be a good one to start with because the developers are actively rolling it out and fixing it right now. Plus it gives you access to a number of brokers all at once, some of them big, all with ~100$ account minimums (not k$).
I've looked at the fix api's for a few brokerages and some seem to be incomplete in terms of supported features: you still need to perform some operations with REST. Have to admit given the choice between websockets and fix, the websockets API's always seem a lot more intuitive, If the fix integration does not reuse across brokerages, this is probably a deal breaker.
Even if TD is not the next brokerage implementation, is there a branch or repo where any work is being done? I am interested in this integration and wouldn't mind lending a hand, time permitting.
Hello all,
I wonder why QuickFIX/n is not mentioned here as a possible FIX implementation in Lean: http://quickfixn.org/ https://github.com/connamara/quickfixn To me it seems to be the natural choice for this task, since it's all CSharp, uses NUnit testing, is open source and configurable (http://quickfixn.org/tutorial/configuration.html), so it should be rather simple to adapt to different brokerages using different versions of this protocol. However, unfortunately the last commit was on October 5th 2016, while there still seem to be some bugs.
Greetings
Thanks for the suggestion @MuSyStQ; it has a pretty sleek API (http://quickfixn.org/tutorial/receiving-messages.html). We're in bug crunching mode at the moment but will resume feature development when the issues from the new release (2.3.0.0+) have been resolved.
@jaredbroad Ah, I understand this perfectly well. I just wanted to make sure that this implementation was mentioned at least.
Oh, since I am very new here (on Lean as well as on GitHub), I want to thank you for making Lean open source and for your hard work. It's absolutely fabulous to have this framework available in CSharp as completely open source with no closed source dependencies (at least as far as I could see).
Thanks @MuSyStQ - its a massive team effort. We're very grateful to the 50 contributors mentioned here: https://github.com/QuantConnect/Lean/graphs/contributors
If you like what we're doing please support the project with a subscription at www.quantconnect.com! :)
TT - traders technologies.
Just adding to the list -- tastyworks, it seems an API will be available this summer.
I suggest:
1) IG'S API https://labs.ig.com/
2) DIRECTA an Italian Broker https://directa-it.github.io/documentation/en.html
Thanks
What about CQG? This is supported by a lot of futures brokers.
Closing thread to help keep issues focused on single topic.
Hi, is there a separate issue for TDA support?
Import brokerage API for TDAmeritrade (perhaps https://github.com/kriasoft/TDAmeritrade) and implement a QC IBrokerage