API programming

wasp

Legendary member
Messages
5,107
Likes
880
Hi all,

Can anyone recommend a good place to start learning how to program an API (specifically with Oanda). I know absolutely zero about programming and to be perfectly honest, do not have a clue where to start. :confused:

The options, as far as I can see, are

Java
C++
VB.NET

All these are foreign to me and although I'm quite willing, have no clue as to where to start.

Any suggestions greatly appreciated!

Chris
 
Chris

If you go down this road then be aware that it's not necessarily a quick and easy process, and you'll need a good deal of time and patience, but at least you have a motivation to actually do it ie to write code to interact with Oanda's API.

What I usually look for is example code, provided by your broker of choice, in this case Oanda (obviously their API fees don't worry you), and see which languages these are written in. I am a VB programmer, which is probably somewhat faster and easier to get to grips with then the other two, in the initial stages at least, but it does tend to limit my choice of brokers a little. I am with IB so it's not so much of a problem, but many other brokers don't provide worked examples in VB. Oanda have all 3 so no problem here, but if you should want to move broker then it may become an issue, as in any case you will have to re-write all your code.

Java and C++/C# are more commonly used (than VB) in the banking/hedge fund world, so if you have any ambitions in this direction, then that may be a consideration.

My advice would be to a search on Amazon for beginners programming books, read all the customer reviews, and buy one that you like the look of. FWIW when I started out I bought a SAMS book (Learn VB in 24 hours), which has served me quite well, but I did have a lot of time on my hands. In retrospect I would probably do Java instead, but this is because I am now more at the commercial end of trading. Large trading institutions are now heading towards the use of the FIX protocol.

Once you get started on one language you are unlikely to want to re-learn another, so best to wait for more opinions from people on this site before taking the plunge. I think that learning to program is well worth the time and effort, it can add a whole new dimension to your trading.

Good luck !

rog1111
 
Last edited:
Which to learn?

Hi Rog1111,

Thanks for the response.

The programming skills will be for Oanda, unless, like you say, I decide to change. It will only be for my personal use (not looking for a career or anything) and hopefully only the once if it works! :LOL: That said, I do wish to learn myself and would rather know everything about what it is opposed to someone else doing it for me and being ignorant.

Do you (or anyone) know which are the most common from a forex brokers point of view? ie interactive brokers, FXCM, etc just in case I do decide to switch. I don't particulary wish to have to learn a second if i do change brokers!

Cheers
 
Java and C# will be more commonly used, take your pick, Java probably easier than C#, but VB easiest IMO. JonnyT or Trader333 among others may have additional comments on this.

There'a always the TradeStation Easy language option too.

GL

rog1111

chrisw said:
Hi Rog1111,

Thanks for the response.

The programming skills will be for Oanda, unless, like you say, I decide to change. It will only be for my personal use (not looking for a career or anything) and hopefully only the once if it works! :LOL: That said, I do wish to learn myself and would rather know everything about what it is opposed to someone else doing it for me and being ignorant.

Do you (or anyone) know which are the most common from a forex brokers point of view? ie interactive brokers, FXCM, etc just in case I do decide to switch. I don't particulary wish to have to learn a second if i do change brokers!

Cheers
 
this may be an option, not sure what costs are involved ? There are many good sources of information out there, it's a bit of a minefield. As I said earlier I would go for a book or maybe a fully functional multimedia tutorial, or better still 1-on-1 tuition if you can afford it.

Another factor might be the development platform, Java is free I believe, but you'll have to pay for VB or C. Some also offer Excel VBA connectivity but this is slower and more limited

rog1111

chrisw said:
http://www.devx.com/DevX/article/10450

As far as basics, any opinions on this...
 
Cheers rog111, just trailing through the various options on Amazon at the moment...
 
Why Oanda?

I would say trade IdealPro with www.interactivebrokers.com

Spreads similar to Oanda but a better fair market and a free API with free code to get you going.

I would go the Java route as you are more likely to get stable, robust code.

JonnyT
 
IB give you free example applications with there free API.

There are examples in C++, Java, Visual Basic and Excel spreadsheets.

JonnyT
 
JonnyT said:
I would say trade IdealPro with www.interactivebrokers.com

Spreads similar to Oanda but a better fair market and a free API with free code to get you going.

I would go the Java route as you are more likely to get stable, robust code.

JonnyT

Very good advice. There is also quite a large development community associated with the IB API, so you are probably more likely to get some help if (when) you get stuck.

You will need the Java Development Kit (JDK) which you can download from here

http://java.sun.com/j2se/1.5.0/download.jsp

and an IDE. There are two popular free IDE's - Netbeans (backed by SUN) and Eclipse (backed by IBM)

you can get Netbeans from here

http://www.netbeans.org

Unless you want to be on the bleeding edge, get Netbeans 4.1 rather then Netbeans 5.

or Eclipse from here

http://www.eclipse.org

I use Netbeans and havn't used Eclipse so I can't really comment on the latter. The have somewhat different approaches to building GUIs. You can find more about this by googling.

Be aware that you are in for a LOT of work if you go down this path.
 
Thanks all,

I appreciate the amount of work this will entail and have been reading through the IB site and various API options and alternatives.

Hopefully, the hard work will be paid of in the long run and be worthwhile...
 
Correct. Without previous programming experience it will be a MAMMOTH task for you whichever language you go for, but hey, we all have to start somewhere ! Have you considered maybe paying someone to do the job ?

rog1111

dcraig1 said:
......Be aware that you are in for a LOT of work if you go down this path.
 
Since posting this thread this morning my mind has slowly become amazingly bogged down with an overwhelming amount of study, reading, learning and analysis that its like starting trading once again.

I can forsee a hell of a task ahead of me but I wouldn't have it any other way, I'd rather learn it and understand it all, however long it may take, rather than pay someone else and be ignorant.

Who needs sleep anyway!
 
Good on ya !

rog1111

chrisw said:
Since posting this thread this morning my mind has slowly become amazingly bogged down with an overwhelming amount of study, reading, learning and analysis that its like starting trading once again.

I can forsee a hell of a task ahead of me but I wouldn't have it any other way, I'd rather learn it and understand it all, however long it may take, rather than pay someone else and be ignorant.

Who needs sleep anyway!
 
chrisw,

In my view it all depends upon how quickly you will be able to learn the language. With Java, it is a highly text based language and for that reason is not the best one to start with. Visual Basic is probably the easiest to learn and there are excellent books on it that make it an easy learning language. I upgraded to VB.NET but you could still get VB 6 which is still used and cheap to get hold of (just check out Ebay). The book I used to learn it is Visual Basic 6 by John Smiley and here is the Amazon link

http://www.amazon.co.uk/exec/obidos...41981/sr=1-1/ref=sr_1_2_1/203-1789023-4327110


Paul
 
Chris,
the fact is that the first language you decide to learn seems impossible, the second darn hard, and so on - I'm now on Tshirt 5 at least ('Been there, seen it, done it, got the....<g>) I've learned to program in a good few languages over the past 30 years, some of which I have been very glad to see the back of.

Mammoth is correct, as previously described, for a task. This is a biggie - learning to program isn't going to happen quickly. From choice I'd pick VB, as it is a little more like normal logic when using it - 'for a=1 to 20 step 2' isn't that intuitive, but it beats "a=1:20:a++" or similar for readability. SDK's to allow programmers to make use of a platform are sometimes darn good, and often include sample code - whilst better than the stupid stuff in most books, which convert US gallons to Litres for the most part (sometimes the examples aren't quite that useful, mind) the example code generally fails to cover the ground you want. Trying to program in a routine to draw candlestick bars on a rescaleable display when your example code makes a smiley pop up at random across the screen whilst making a 'beep' noise can be a tad frustrating.

Be prepared to spend years on this.

(Good news, it's an absorbing hobby). There is a reasonable amount online for any language, after VB I'd pick VC++ or VC# (you'll find java etc similar, C# would be a better apprenticeship than java I'd suggest) .. lots of good books for this - sybex produced one for Vis Basic 6 for $20 (UK price therefore, obviously, £21.99) that was the main section of 4 individual books glued together to make a 1000 page one off for example .... Microsoft do good books, but tend to spread the important info across half a dozewn volumes at £50 a pop. Anything calling itself 'VC# in 24 hrs' or similar should be avoided with the assistance of a large bargepole - they tend to zero in on teaching you to do three specific, useless thngs and you're no better off but £20 poorer for buying them.

Microsoft's languages come with some CD's, the MSDN (M'soft developer network) which is actually a very large help file containing lots of docs and info - it takes a while to find your way round it, it can be frustrating to navigate. Still, you've got years, right? <g>

You can also, quite often, get online help from BBS's set up to support the development - I work on esignal stuff in javascript as well as VB for example, and there's a developer BBS I can go ask for help on.

Dave
 
DaveJB said:
'for a=1 to 20 step 2' isn't that intuitive, but it beats "a=1:20:a++" or similar for readability. Dave
Hopefully one day this will all make perfect sense! :LOL:
 
Well,
you did say
however long it may take
...didn't you? <g>

Sadly programming isn't something you get good at quickly. Which kinda makes it seem even less fair that once you CAN program any idea you like, you don't actually become a noticeably better trader as a natural progression - rowlocks in, rowlocks out, .as Admiral Hornblower probably once put it ... at least I think that's the phrase used at the time....
 
Top