API by Malcolm Morley

This topic is a bit more specialised than the others in this section, and will only be of interest to a few.

OANDA has a api (application program interface) that enables direct computer communications between client computers and their servers. Earlier this month (July 2004) I started developing my own systems to use this interface, and recorded my first impressions on a private forum.

This topic is a bit more specialised than the others in this section, and will only be of interest to a few.

OANDA has a api (application program interface) that enables direct computer communications between client computers and their servers. Earlier this month (July 2004) I started developing my own systems to use this interface, and recorded my first impressions on a private forum.

The following is an extract:

quote..

………yes, I’ve just taken on board OANDA’s api, and am doing the programming (in Java) myself. xxxxxx is also interested in this project, and we have discussed this quite a bit privately.

From my perspective am extremely happy with it. However it is not for the faint hearted. You may have seen posts of mine where I’ve said I prefer Wealth-lab over TradeStation, because you have more control. Same thing here; what you get is an application library of system calls (class objects actually), that enable you to interface with your account on their servers. You only get the building blocks (plus an example program), and the rest is up to you. If you wanted too you could write the thing we know as the FXTrade platform with the library as it covers all the low level functionality, providing you put it together correctly – ie login, getting sub-accounts, getting balances, getting rates, getting recent price history, etc, etc. It also has all the calls necessary to place and manage orders and trades. The only thing the api doesn’t include is a call to your formal account history.

As I’ve said, I’m doing all my own development. Although I’m new to Java; I’ve done a lot of programming, and I really enjoy it. Now I’m through the first week’s learning curve, I’m finding it very straightforward. Quite honestly, I would not feel comfortable running an api such as this, if I hadn’t written the code myself. Get it wrong, and it could clean your account!

So far my biggest effort has been to make the api programs bullet proof. I’m writing them so they can run unmanaged all week 24/7. That means they have to handle communication and session failures, and restart in a logical fashion, without intervention (and do the job!). I think I’m there now, but I’m still testing. Remember I have a lot of sub accounts, and that is also an issue. Note also, I said ‘api programs’. The api supports multiple concurrent sessions! By that I mean you can write multiple api’s, and log them all in at once! How good is that?

I’m not sure how to answer your question – how you interface with FXGame … The key to success is knowing WHY you want the api in the first place. If you have a WHY, you should then know immediately by just your familiarity with FXTrade/Game whether what you want to do is possible. If you can do it manually in FXTrade, you can do it with the api – just far more frequently and far more accurately.

Do you have to develop a GUI front-end? Not really. The thing you are probably building is an execution engine, and/or a data collector. Certainly the former and quite possibly the latter are perfectly suited to console operations. Earlier I said I want my programs to run 24/7 unmanaged. You don’t need a GUI front-end for that. Later perhaps, but very low priority. Also you don’t need to write anything that FXTrade already does, as you can run the platform in parallel.

Can trades be triggered by time? Sure: Java is a threaded application and you can control time to a millisecond! It’s pretty much straight forward programming.

I’d just add that was surprised at my bandwidth usage. My Internet account used to use about 1GB per month. Now I’m using about 250 MB a day and I’ve only just started. Beware if you plan to move to the sticks!

In closing I’d say that I’m extremely excited about the whole thing, but you MUST know why you want it, before you even consider it.

Hope the above helps. If you can ask specific questions, I’ll try to answer them.

Malcolm

For those who want more information on OANDA’s api:

http://fxtrade.oanda.com/fxtrade/api/index.shtml

I have lived and breathed trading ever since trading fx professionally in London, Toronto and Philadelphia in the early 70's (yes I know that shows my age!). While my professional career subsequently took me from the trading desk to designing treasury systems for some of the world's leading financial institutions, my desire was to always trade for myself. As a consequence, following 5 years with a major international stock-broker (the last 3 as... More