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.
Do you know an API that lets you trade with real life stock or currency?
If so, please describe your experience:
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.
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.
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.
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.
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.
Try TD Ameritrade - they have a nice API, relatively low trading fees, and a good help forum . Link to their API offering overview.