My basic question is: How can I go from R to trading?
Let's assume I have a volatility model. I.e. I am analyzing the volatiliy of stock returns. I am able to forecast the volatility of tomorrow (please do not focus on wheter my model/theory makes sense or not). Now I want to execute trades from R, depending on my results I calculated in R.
My question is how to do that?
E.g. in Interactive brokers there is the TWS system and the TWS Api. So if I would focus on Java, does this mean, I have to use e.g. netbeans, call the R code in netbeans, then code in netbeans command that execute the trade and send this trough TWS to my IB account?
Or is there an easier solution, e.g. if I got it right IBrokers package - do I need a TWS Api there? Or do I just have to have an IB account, then run my R command and R is able to execute the trades and I can see it in my IB account? Do I need an IB Api in this case? Or is it always necessary?
Your always going to need some kind of bridge/middle ware to be able to execute. Picking one that suits your needs is the key. If your writing directly to the exchange via FIX protocol then you can code in C++/Java what have you and have that run from your R or just re code model in C++/Java so that you can be executed faster. IB plug into R seems to probably be the easiest but I have never used it. For the most part anything that I have modeled in R has been compiled in a faster language and then executed from there using FIX. Sorry I couldn't be of more help.
IMO, R is great for analysis, but it doesn't have the infrastructure for a full blown trading platform. It would require you to implement the missing pieces and/or contribute them to an open-source project.
Either you can take your chances with R and IBroker or you port your strategy to a retail trading platform like NinjaTrader, TradeLink, MultiCharts, or MetaTrader. This will give you more broker options and most of the trading infrastructure and trade monitoring/analysis you need. All are free for development except MultiCharts.
NinjaTrader is the most popular around here. We're all patiently waiting for the next-gen version 8.
I started using R only two months ago and already the platform is better for my needs than all the retail packages out there.
There is an R package called IBrokers that is plenty to get you started with IB's API. You can easily create the functions you need around it. I have been using it and it works great.
Keep in mind you should not use IB for data. Plenty of threads discuss that. I am using IQFeed for data but you can use whatever you want.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The following 2 users say Thank You to Big Mike for this post:
Thanks a lot for your help, but:
1. I cannot access your link, I get the error message:
FoReGaRch, you do not have permission to access this page.
Return to home page
and then a text about the elite membership
2. Why shouldn't I use IB for data? If I am trading with IB it would make sense to use the data they are giving, otherwise I may have differences in the data and I will have problems resulting from this with implementing my trading strategy?