views:

3885

answers:

7

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.
+1  A: 

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.

Elie
+5  A: 

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.

dirkgently
FWIW, I don't think the MetaStock API allows you to make trades; their software is strictly Technical Analysis, so it just gets prices.
Jeff Barger
@Jeff Barger: There's some kludge: <http://www.elitetrader.com/vb/showthread.php?threadid=17343>
dirkgently
A: 

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.

Davorin
+1  A: 

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.

anon
+2  A: 

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.

Jon
+4  A: 

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

TD Ameritrade has huge costs. I mean - why pay $10 per trade when you can use Interactive Brokers, and pay $1 per trade? Its no contest.
Gravitas
+1  A: 

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.

baskin