Real life trading API

Web ServicesApiFinance

Web Services Problem Overview


Do you know an API that lets you trade with real life stock or currency?

If so, please describe your experience:

  • ease of development
  • commissions
  • sandbox environment?
  • etc.

Web Services Solutions


Solution 1 - Web Services

AFAIK, TradeStation is the most famous of the lot. Most other trading softwares provide APIs (NinjaTrader, MetaStock etc). FWIW, there are even competitions of automated trading systems -- see this.

Also, this is something that the exchange has to support and your broker has to allow. Most exchanges I know of, do not allow automated trading without prior permission.

Solution 2 - Web Services

There are many brokers who will give you access to an API which lets you trade. Obviously you will be paying commissions to them as well as the bid/ask spread which may be wider than the direct markets. They will all differ in the types of instrument that they allow you to trade.

If you want an easy way in, you can use shrink-wrapped software such as Tradestation (horrible proprietary language), NinjaTrader (a little better, C#-based), or SmartQuant (better, C#-based). These generally have pre-built interfaces to a number of brokerages who will actually execute the trades. InteractiveBrokers also has a direct API but they have a reputation for being a pain to deal with.

I would recommend checking alternative forums, such as EliteTrader which has a wealth of information on the relative merits of different brokerages. There are also plenty of folks on there trading through APIs.

Solution 3 - Web Services

Try TD Ameritrade - they have a nice API, relatively low trading fees, and a good help forum . Link to their API offering overview.

Solution 4 - Web Services

Most electronic stock exchanges don't provide an API, they provide a message specification. To get them to accept your messages (i.e. to trade directly with them), you will have to spend a very large amount of money. and become a member of the exchange - that's what IBs do. Even a live market data feed (which you would need in order trade sensibly) can be ridiculously expensive.

Solution 5 - Web Services

This is similar to a question I asked a couple of years ago: https://stackoverflow.com/questions/59327/what-online-brokers-offer-apis

I would recommend looking into Interactive Brokers, which is the one I ended up choosing. Their API supports multiple languages including Java, C++, ActiveX and Excel's DDE. You can effectively do just about anything via the API that you can do using their fairly robust trading platform.

As a broker alone it's hard to beat IB's crazy low commissions (most of my orders are so low they get rounded up to the $1 minimum commission per order). Combine that with a fairly straightforward API and it's hard to beat.

Also, take a look at my question (linked above, and here) for more information on brokers that offer APIs.

Solution 6 - Web Services

I've just started playing around with TradeKing's API. Its dead simple and uses oauth. The $5 trade commission isn't bad either.

E-trade also has an api, but you have to go through some hoops to get production access. They also provide realtime streaming via a comet interface. There don't seem to be any libraries out there for etrade either except for the java ones etrade provides.

Solution 7 - Web Services

https://www.quantopian.com

i suppose the newest, but has an online ide / debugger / visualizer, and integration with interactive brokers for paper trading and real trading. great community for R&D too

Solution 8 - Web Services

Go through the links on this page.

Lists a number of open source api's. Haven't tried any yet, but planning to check out active-quant.

Solution 9 - Web Services

Contact your target Stock Exchange for trading API and test server. If your target Stock Excnage is on OMX platform, you will be provided with X-Stream API (unmanaged c++) and docs.

Solution 10 - Web Services

I believe there is an API for working with ETrade and some of the other trading software. I don't think you're going to find an API for executing trades without making use of a commercial product, though. If you're trying to do some analysis of trades, though, there are APIs available for retrieving quotes, listening to ticks, getting historical data for a symbol, etc. As I said at the beginning, many of the existing commercial products have an API for writing code to work with them.

Solution 11 - Web Services

You may also want to take a look at TD Ameritrade .NET SDK hosted at Github

Solution 12 - Web Services

I have used NinjaTrader and MetaTrader to trade currencies and futures products.

Ninja trader is very easy to use. I don't have super in depth coding skills although I can hold my own, and it worked for me just fine.

Their application is free to download. They have also created an "app" where you can choose different technical indicators to create trading strategies.

Having traded for awhile using automated systems, winning and losing, I would highly suggest using TICK DATA when you trade. Automated trading in the sense where you are using technical indicators to make your trading decisions is very competitive and very fast. Meaning, if you are using data such as 1min data, you are going to be behind the profitable trades, if there are any for your system.

I can tell you that as a day trader, the days of sitting at your screen and trading when the 1 min moving average crosses the 10 min, or something similar to that, are over. Not to say longer term strategies don't work, they do, on the daily charts.

My point is, use tick data no matter what platform you use. Ninja Trader is pretty good. Sign up for the tick data, and use that to trade. You'll have a better shot at being profitable if you are using technical indicators.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionflybywireView Question on Stackoverflow
Solution 1 - Web ServicesdirkgentlyView Answer on Stackoverflow
Solution 2 - Web ServicesJonView Answer on Stackoverflow
Solution 3 - Web ServicesMattMView Answer on Stackoverflow
Solution 4 - Web ServicesanonView Answer on Stackoverflow
Solution 5 - Web ServicesWilcoView Answer on Stackoverflow
Solution 6 - Web ServicesAdamBView Answer on Stackoverflow
Solution 7 - Web ServicesJasonSView Answer on Stackoverflow
Solution 8 - Web ServicesbaskinView Answer on Stackoverflow
Solution 9 - Web ServicesDavorinView Answer on Stackoverflow
Solution 10 - Web ServicesElieView Answer on Stackoverflow
Solution 11 - Web ServicesKonstantin TarkusView Answer on Stackoverflow
Solution 12 - Web ServicesRyan KephartView Answer on Stackoverflow