Will R become bottleneck in my C++ HFT application? Hello Matlab Coder toolbox? #matlab

(Last Updated On: November 22, 2012)

Will R become bottleneck in my C++ HFT application? Hello Matlab Coder toolbox?

Find out how I proceed with this by joining my newsletter 

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.

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

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!
This entry was posted in Featured, HFT High Frequency Trading, Matlab, Premium Membership, Quant Development, R and tagged , , , , , , , on by .

About caustic

Hi i there My name is Bryan Downing. I am part of a company called QuantLabs.Net This is specifically a company with a high profile blog about technology, trading, financial, investment, quant, etc. It posts things on how to do job interviews with large companies like Morgan Stanley, Bloomberg, Citibank, and IBM. It also posts different unique tips and tricks on Java, C++, or C programming. It posts about different techniques in learning about Matlab and building models or strategies. There is a lot here if you are into venturing into the financial world like quant or technical analysis. It also discusses the future generation of trading and programming Specialties: C++, Java, C#, Matlab, quant, models, strategies, technical analysis, linux, windows P.S. I have been known to be the worst typist. Do not be offended by it as I like to bang stuff out and put priorty of what I do over typing. Maybe one day I can get a full time copy editor to help out. Do note I prefer videos as they are much easier to produce so check out my many video at youtube.com/quantlabs