R vs MATLAB

Quote from amazingIndustry:

I would neither go with R or Matlab or Python. I dont like interpreted languages, even when writing efficient vectorized code in R you can still run circles around it with a very well written C# code and new .Net 4.0 libraries. Why I say that is because you end up using bits and pieces of many different programs and potentially programming languages to achieve what you want. Profiling? Hmm, maybe a bit R or Python? Backtesting? R? Distributed and/or Parallel? Matlab? High performance? C/C++? Ease of integration? None!!! If you are a mature C/C++ coder then stick to it. If you really want to step up from Excel and have to learn a new language anyway I can really only highly recommend C# on .Net 4.0. What gives you more flexibility than that? How much more can you tweak back tests than through completely customizable functions and code?

My experience (I worked for many years as quant in rates exotics) and programmed in C++, now for years in C#) is that most quant newbies try to accomplish things in R and Matlab in banks and hedge funds. Why? Because it looks fancy when you show it to your boss. A nice cointegration chart from R looks better than some ugly numbers coming out of a console C# app. Also it gives the impression you are analytically versed, while coding just gives away the info that you know how to program, not necessarily that you are able to analyze data. So much these days is about perception, ideology, and making impressions. If you can afford to not having to sell your soul to a bank or hedge fund I highly recommend to look for a package/language that really lets you do what you want to do. Python is incredibly slow and also in R I have not seen a single library that could beat the processing power of my simply C# backtest platform. I process around 5million ticks per second, which includes loading the data in binary format from files, deserializing the data, merging multi symbol feeds, serializing, sending over a tpc stack, utilizing an open source library (ZeroMQ for messaging purposes), deserializing again at the recipient side, and running a high frequency strategy in back test mode, all that at 5mil ticks/second. Please show me a single package, distributed, parallel whatever, in Python, Matlab, R, that can accomplish that. Any.

My point is that fancy graphics and an IDE with lots of libraries ( others wrote and most users dont really understand anyway other than invoking couple functions they expose) is great to get one started and it sounds like the way to go to get to the next level but is it really worth the investment? Python shows off crafty libraries with access to hdf5 db files, yet my simple binary file based datastore runs an order of magnitude faster than that. A lot of marketing and hype by those who do not want to get their hands dirty coding too much, but in the end you still suffer from the same limitation than any platform that does not expose a pure programming language, lack of flexibility. Maybe you end up with a little more code in C/C++/C# than R, Matlab,Python on basic functions and algorithms but once you require more flexibility you are stuck with interpreted stuff. (Note I am not implying all listed languages or packages I am not fond of are interpreted languages or based on interpreted languages).

My recommendation in one sentence: Go with a real programming language, if you want to be professional and take your business seriously. R is to play/toy around with ideas, please do not tell anyone you are running live trading strategies in R, Matlab or Python, people who know this specific business will laugh at you. And why would you want to completely segregate your testing platform from the implementation platform??? I turn a switch and the historical tick based data feed passes control over to a live data aggregation and consolidation engine that feeds the very same trading strategies that I ran tests over just seconds ago. No code changes, no additional testing, no more unit testing, no nothing. Test, evaluate, run. Keep things efficient.


Thanks for very useful information. I'm quitting slow analysis in VBA trying to check out something else, and was looking for C#, but then I got to read about all these other programs and languages.

I'll stick with learing C#, even though I think it will be a steep learningcurve!

Kind regards
Espen
 
Quote from amazingIndustry:

most quant newbies try to accomplish things in R and Matlab in banks and hedge funds. Why? Because it looks fancy when you show it to your boss. A nice cointegration chart from R looks better than some ugly numbers coming out of a console C# app.

...

My point is that fancy graphics and an IDE with lots of libraries ( others wrote and most users dont really understand anyway other than invoking couple functions they expose) is great to get one started and it sounds like the way to go to get to the next level but is it really worth the investment?


Any of the available options have their strengths and weaknesses. The nice charts and graphs from R are no fluke. R is extremely good at visualization. As an investment, VisualStudio (for both C/C++ and C#/VB.NET) is a great IDE to invest in.

I see nothing wrong with mixing and matching, as long as you are aware of the strengths/weaknesses/tradeoffs involved. Visualization in R, analysis in C#, website in PHP, trades in C++, xyz in ABC.
 
Quote from amazingIndustry:

I trade fx, thus quotes are just bid and offer price updates, no depth (its irrelevant on the fx side).

Could you explain why depth is irrelevant in FX trading?

I know there is no central exchange in FX market so the depth is only relevant for the broker/dealer you are working with, but still, I think depth will give microeconomic insight into where the market is headed.
 
Quote from JohnTrader:

Why software such as Amibroker, NinjaTrader, Tradestation, Multicharts, Wealth-Lab… would not fit your needs?

Most of of them only offer only canned routines within a closed proprietary environment that is limited in scope.

Most do not have things like multiple cointegration models, multiple option pricing models, adequate performance analytics (VAR etc.), or anything like the data handling (time frame transformation) graphics capabilities of R (or Matlab) or the richness of the graphics tools of R. (Some do have some of these capabilities).

I have found that most of them cannot even do simple tasks such as handle say butterfly spreads and butterfly spread orders.

Also, in the case of R, all of this is open source so it is easier to reimplement it later in C or whatever when needed than if you are locked inside a proprietary environment using tools whose algorithms are at best loosely documented.
 
Quote from sle:

It's not like R has anything that can be used to market-making either (nor do any commercial packages actually calculate greeks well enough to be included in the AMM process), but the Rmetrics stuff is usually good enough for simple portfolio management.

Hmm. How about AMM through Orc Liquidator?
 
Quote from Rationalize:

Hmm. How about AMM through Orc Liquidator?

Or Actant, or TBricks. I think there are plenty of commercial tools that calculate things properly. It's just that these tools cost a heavy engagement ring per month and are not aiming the small retail investor.

Cheers
 
Quote from ghostrider77:
Or Actant, or TBricks. I think there are plenty of commercial tools that calculate things properly.
Calculating your deltas with the functions included in either is a sure way to get arbed.
 
Back
Top