Will R become bottleneck in my C++ HFT application? Hello Matlab Coder toolbox?
As my march to this HFT continues, I have to make a serious decision over the coming day. As I already have ignored some wise advise about my real time market analysis engine, I have already gone down the wrong path for a little bit with my original choice of using R for my analytics in real time. Ha ha.. Others believe it would be a bottle neck. After researching my open source Streambase option, I am quickly realizing yes R will be a huge bottleneck for this system. I have played enough with it where it takes usually more than 2 seconds to do a complete analysis on whatever R script I run. It does come down to of course running RCPP and RInside within the C++ application. This would work fine for 1 minute frequency data but would choke on a tick basis. I am really trying to design this system for real time tick based analysis namely to enable this system to be high frequency trading ready. Any delays of 2 seconds or more is a kiss of death in HFT! I don’t want to face a rewrite down the road. So the question becomes: Will R become the bottleneck I don’t want? Sadly, no matter how hard I try, I come back to the answer that R will not cut it quite possibly in this environment. What are my options?
I really don’t like hand coding trading strategies so my only option is to crawl back to Matlab to use the original Coder toolbox which will export any Matlab M script I create to C/C++. It is kind of cool but it will be limiting on what is supported during the code generation process. What else do I have? Not much really. I have confirmed with some inside contacts at MathWorks that some hedge funds use this method of converting their model or strategies into live trading environments.
This really sucks donkey balls having to flip from Matlab to R back to Matlab for the analytics prototyping. But this Streambase like option really answers the critical needs of real time data analysis. Some may get excited by this, but others will be saddened if I go back to Matlab. Sorry to all.
Unfortunately, this whole journey has been about exploring the different ways to develop this HFT platform. As I have been saying most recently, nothing is final until you see trading with live money.
I hope you understand this decision.NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!