Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

I want to implement my models in R and trade according to them with my IB account. Now I am wondering, how I should solve this problem? Do I need to program with C an access (https://www.interactivebrokers.com/en/?f=%2Fen%2Fsoftware%2Fibapi.php) or is there a solution, where I only need R and IB?

How do profeesional people solve this issue? And what about the IBrokers package in R, is it still valid? It seems to me a bit outdated, is there a better package? Thanks for sharing your wisdom in advance!

share|improve this question
    
If you're comfortable integrating R and Java, the Java API is very easy. I used that API with java-websocket to make a custom position tracking system through a browser very quickly. –  user6500 Dec 23 '13 at 5:53
    
@quantycuenta Thanks a lot, but what does "through a browser" mean? I mean if I have R some Java program (netbeans or so) and the TWS system of IB with the Java API, is that all I need? Is this the "best" / most efficient way to do this? –  Jen Bohold Dec 23 '13 at 9:10
    
This is a beginners question I hope you don't mind: How does this work and how do they connect? I call in my Java environment some R code which does fancy calculations and gives me a value. Then depending on that value I sell or buy a certain option. So still in my Java environment I write the command to buy/sell an option. When running this code the command is sent to the Java API which further sends it to the TWS system? Or is it directly out of my Java environment send to the TWS system? Why do I need the additonal Java API? What is the difference from TWS system to using the IB Gateway? –  Jen Bohold Dec 23 '13 at 9:14
    
I was just trying to explain how easy it was to program with the IB java wrapper with the websockets example. Actually, after reading your second comment, and assuming you're ok with jquery/HTML5, that would be the way to go on the frontend, imo, and just trade through TWS. Few hundred lines of code for me. json2html really helps. I can give you a general structure for the ib-websocket fusion if you like. As for the R-java fusion, I can only superficially help: R is interpreted (if memory serves), so java should always outrun it. –  user6500 Dec 23 '13 at 9:42
    
You can get them talking with this stackoverflow.com/questions/7451716/java-r-integration. TWS is the trade platform. The IB gateway is merely an authentication portal for your custom app. I prefer not to buy and sell through a custom app myself. I'm a one man show and don't have an expert looking over my shoulder to prevent me from destroying myself with code. I track with my custom app, and it's easy to see if something's going wrong with that. Open another question so all can benefit on the java api reporting question, so all can benefit, if you please, and i'll answer. –  user6500 Dec 23 '13 at 9:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.