R vs Python vs matlab: the quant language war - Matlab, R project and Python | futures io social day trading
futures io futures trading


R vs Python vs matlab: the quant language war
Updated: Views / Replies:21,034 / 26
Created: by treydog999 Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

View Poll Results: Which Quantitative Development Language?
R 36 39.56%
Python 43 47.25%
Matlab 12 13.19%
Voters: 91. You may not vote on this poll

Reply
 1  
 
Thread Tools Search this Thread
 

R vs Python vs matlab: the quant language war

  #11 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

A new prospect: Julia

My personal preference is Julia, although one must understand it is not yet as mature as R or Python. In fact current language version in development is 0.4 and obviously the ecosystem is not as huge as Python R or Matlab but growing fast. The goal is to achieve performance within 2x C overall and breaking two-language-pattern (one for prototype and one for performance). I don't think I would go live until 1.0 but I am working slowly on moving some of my code from Matlab.

Why Julia:
1. It is (being) designed with fast computation in mind with C speed iterative loops
2. Designed for/by scientific/technical community yet still being general programming language (like python)
3. Based on Lisp (good metaprogramming, macros), some consider it a Lisp dialect
4. Multiple dispatch
5. Matlabish syntax easy to grasp even by nonprogrammers
6. Seamless integration with C and Fortran
7. Very good interface with Python, good with R and Matlab
8. Open source, MIT licence
9. Still in active development (nice langauge features on the horizon)

Cons:
1. Still in active development (almost certain breaking changes, not fully optimized yet, not enough packages yet)
2. Small number of financial packages yet - some in development eg: JuliaQuant
3. Some ideas OO programmer needs to get used to: multiple dispatch, lack of encapsulation, etc.

For some more thorough exploration of Julia language design here is a doc by its core developers:
Julia: A fresh approach to numerical computing

Reply With Quote
The following 2 users say Thank You to gregid for this post:
 
  #12 (permalink)
 Vendor: sentimentrader.com 
Tulsa, OK
 
Futures Experience: Advanced
Platform: Tradestation, TOS, Python
Broker/Data: IQFeed, Tradestation, TOS
Favorite Futures: ES, SPY, Options
 
ericbrown's Avatar
 
Posts: 201 since Jan 2011
Thanks: 339 given, 234 received

I'm a python guy. Is it the 'ideal' language for backtesting, strategies, execution? Maybe...maybe not. The work I do is on long-term intraday and swing trading and my strategies are very simple and I need only simple reporting for what I need and how I analyze strategy outcomes.

I know that some will say R is much more robust and more mature...and it is in many areas. Python doesn't have anything that can touch blotter/PerfA, etc but I don't need 99% of the functionality of those packages.

Python is what I use for just about everything so it makes sense for me to continue using it for the markets. I do some basic stuff in R but I've just not found the functionality in R or R packages that I cannot replicate in python myself.

Lastly...I can do my research in Python and then when ready go straight to production with the same code. It makes it easy for me.

Reply With Quote
The following user says Thank You to ericbrown for this post:
 
  #13 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


I would personally hate the situation where one language would win the "(quant) language war".
You could define that period as technological stagnation (if not a decline). Programming languages and concepts feed of each other and provide us all with the tools we like and use.

So my advice to anyone asking which language to choose is this:
Choose the one you are the most comfortable with and most engaged/excited about and then you will see you will find plenty of reasons why your choice is the best one !

Reply With Quote
The following 4 users say Thank You to gregid for this post:
 
  #14 (permalink)
 Vendor: sentimentrader.com 
Tulsa, OK
 
Futures Experience: Advanced
Platform: Tradestation, TOS, Python
Broker/Data: IQFeed, Tradestation, TOS
Favorite Futures: ES, SPY, Options
 
ericbrown's Avatar
 
Posts: 201 since Jan 2011
Thanks: 339 given, 234 received


gregid View Post
I would personally hate the situation where one language would win the "(quant) language war".
You could define that period as technological stagnation (if not a decline). Programming languages and concepts feed of each other and provide us all with the tools we like and use.

So my advice to anyone asking which language to choose is this:
Choose the one you are the most comfortable with and most engaged/excited about and then you will see you will find plenty of reasons why your choice is the best one !

Great answer.

Too many times I've seen things like "R is the best..." or "Python can't do that". Either language is great...pick what works for you.

Reply With Quote
The following user says Thank You to ericbrown for this post:
 
  #15 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


artemiso View Post
I'm not a huge fan of Julia. I think the biggest structural flaw with Julia is the fact that this was the first selling point that you can think of:



This is not really an exciting new feature from the perspective of seasoned developers. The frontier of optimization and fast computation has to do with exploiting data parallelism in the message passing layer (e.g. MPI, Solace), task/thread layer (OpenMP or pthreads) or the SIMD and vector layer. Google had the right philosophy putting Ken Thompson and co to work on Golang, although I'm not confident that it will take a major market share either for a variety of reasons (e.g. no support for parametric polymorphism).

Especially with 512 bit SIMD coming to the new Intel architecture - by the way, already present in the Xeon Phi coprocessors, "C-speed iterative loops" is a doomed mindset.

Every language that doesn't attract good developers who are willing to spend time to build production quality libraries is always going to remain an esoteric community and not going to find wide use in the financial industry.

Finally, when discussing the traits of different programming languages, I like Guy Steele's talk - which puts into perspective several things that matter which have nothing to do with the theoretical advantages of the language itself.


[quoting your full post for posteriority, just in case would be tempted to delete it... again ]

As to the answer - you made it sound almost like I would believe Julia is my new God. The reason I posted the iterative loops argument is clearly the context of the previous post where iterative loops where mentioned, so there is no need to impute anything I didn't say.

As I mentioned before I am a great fan of competition in the realm of technology

Also the matlabish syntax should give a hint on the target audiences of Julia - people not necesarilly interested in dwelling into software engineering but requiring tools to help them solve their problems (research, trading, etc).
When you say quant you think financial industry, HFT etc., when I say it on futures.io (formerly BMT) I think individual/semi professional traders (SPT). When you think parallelism you think cluster computing, while SPT just wants to use all his CPU cores.
I feel we are comparing apples to oranges.

Anyway thanks for your input - always appreciated. I am looking forward to watching the video you posted as it looks really interesting.

Reply With Quote
The following user says Thank You to gregid for this post:
 
  #16 (permalink)
Elite Member
Manchester, NH
 
Futures Experience: Beginner
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: Stocks
 
Posts: 902 since Jul 2012
Thanks: 603 given, 1,785 received


gregid View Post
Also the matlabish syntax should give a hint on the target audiences of Julia - people not necesarilly interested in dwelling into software engineering but requiring tools to help them solve their problems (research, trading, etc).
When you say quant you think financial industry, HFT etc., when I say it on futures.io (formerly BMT) I think individual/semi professional traders (SPT). When you think parallelism you think cluster computing, while SPT just wants to use all his CPU cores.
I feel we are comparing apples to oranges.

I apologize if I came across as though I was misrepresenting your view.

My point was not that Julia isn't a useful language to the "semi-professional traders" as is - rather, my point was that I don't think that Julia will attract a critical mass of good developers (traders or not) to build useful libraries and take the language to greater heights, and hence wouldn't be a good prospect for either "semi-professional traders" or more sophisticated traders (the financial industry on a whole).


gregid View Post
Anyway thanks for your input - always appreciated. I am looking forward to watching the video you posted as it looks really interesting.

You're welcome.

Reply With Quote
 
  #17 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 894 since Jul 2012
Thanks: 291 given, 1,006 received


ericbrown View Post
Great answer.

Too many times I've seen things like "R is the best..." or "Python can't do that". Either language is great...pick what works for you.

I honestly want to say that I started this and doing serious research into this due to the fact that I think Python is a great language. Not to mention the fact that it is much faster and due to multiple language libraries that act as a bridge language. Either end to end research execution or link into several languages if they are already part of a complex tech stack. Making integrating python into almost any existing structure really easy.

Both R and Python are extremely good at what they are meant to do. R is mostly focused on mathematics, statistics, and research but has capability to be an end to end package. Python is a easy to learn, fast, general programming language with multiple language interfaces, but also has the capability to do mathematics, statistics and research. They are really 2 sides of the same coin, which part of those main attributes do you want/need the most, or are more comfortable with. But as with all things its a give and take, if there was 1 package that did both parts equally well. A winner would be decided in a second and we probably wouldn't be having this healthy debate. As stated earlier both are programming languages, you can pretty much make happen anything you desire.

To be honest, I have been searching and reading about this for weeks, and I think our current poll stats show a tie between R and Python. I think that is for good reason, both are extremely strong. Comfort with a language makes you more productive in it, whatever that language is. I don't want to sound like a python basher because I want to find every reason in my own mind for me to switch over, or at least have a working knowledge of it so it can become an alternative language I can link into R. If python were to over take R in the maturity of its package eco system, or having more packages specifically for computational finance and system development I would be the first to jump ship.

Reply With Quote
The following 2 users say Thank You to treydog999 for this post:
 
  #18 (permalink)
Trading Apprentice
Ipswich UK
 
Futures Experience: Beginner
Platform: Meta Trader 4
Favorite Futures: Forex
 
Posts: 2 since Jan 2015
Thanks: 0 given, 0 received


treydog999 View Post
.... If python were to over take R in the maturity of its package eco system....

It seems python took over in the poll stats (7:13:2 as of now)
One other (nice) facet to python is integration with Visual Studio .NET for the c# lovers out there.
As always, there is no definitive right/wrong answer to this, and it depends on your skill level in any of them and what you want to achieve.

Reply With Quote
 
  #19 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 894 since Jul 2012
Thanks: 291 given, 1,006 received


mkjonhston View Post
It seems python took over in the poll stats (7:13:2 as of now)
One other (nice) facet to python is integration with Visual Studio .NET for the c# lovers out there.
As always, there is no definitive right/wrong answer to this, and it depends on your skill level in any of them and what you want to achieve.

Yes it has but i still believe the trading and financial ecosystem is really weak compared to matlab or r. It is a much better choice for end to end integration if you are running solo. But if you have someone or a department who will re encode things into the execution language then matlab and r are the clear winners. Or even yourself as you would gain execution speed and parallel processing that python afaik is difficult to implement.

I have a lot of respect for python but the dozens of hours i have spent just to try to clone the blotter r package was just not worth the additional processing speed. I could have done the tests in R and converted to C++ or C# in that time. Or used matlab simulink and convert to C.

Wes Mckinney pandas packages are great but they are just clones of the native R dataframe.

I know that in the several firms has picked up acceptance for using python. But they are keeping a lot of the code inhouse or developing analytics from scratch with a pandas base. IHMO reinventing the wheel. Although in their case it may be advantageous as they can refactor their tech stack around it. And maybe load up legacy C code into python. But both R and matlab have that capability.

Its just my current take on it. The poll speaks for itself but from the time i started this thread and now. The changes in the python ecosystem has been minimal especially in regards to trading.

Reply With Quote
The following user says Thank You to treydog999 for this post:
 
  #20 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 894 since Jul 2012
Thanks: 291 given, 1,006 received

great analysis of a paper A Comparison of Programming Languages in Economics


A Comparison of Programming Languages

Overview is that the baseline performance is C++

Basic Packages:

Basic Cpython runs 155 and 269 times slower than in C++.

Matlab is between 9 to 11 times slower than the best C++ executable.

R runs between 475 to 491 times slower than C++. If the code is compiled, the code is between 243 to 282 times slower.

Using Hybrids:

Using the Pypy implementation, it runs around 44 times slower than in C++.

when combined with Mex files, Matlab is only 1.24 to 1.64 times slower than C++

combined with Rcpp, R is between 3.66 and 5.41 times slower.

Reply With Quote
The following 2 users say Thank You to treydog999 for this post:

Reply



futures io > > > > R vs Python vs matlab: the quant language war

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
IB with Python jamesico Matlab, R project and Python 2 September 9th, 2014 08:19 AM
Tradier with R and or Python Keith Leesus Matlab, R project and Python 2 September 5th, 2014 01:23 AM
Python Help Wanted $ wlblount Hire a Consultant or Programmer 0 December 25th, 2013 10:14 AM
quant.stackexchange.com shodson Platforms and Indicators 3 February 11th, 2011 04:18 PM
[Other]       Open Quant / Quant Developer niterate Platforms and Indicators 2 December 5th, 2010 10:10 PM


All times are GMT -4. The time now is 08:35 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-10 in 0.18 seconds with 21 queries on phoenix via your IP 54.83.122.227