Programming Languages Across Quantitative Finance Workflows
Summary
The document surveys languages reported in quantitative finance and relates language choice to different parts of a trading and research workflow. It describes compiled languages such as C++ and Java as common in infrastructure and data-vendor integrations, while MATLAB, R, Python, and similar tools are associated with research, prototyping, and statistical work. One practitioner account describes using MATLAB for empirical research and C++ functions to speed up backtests, then choosing C++ or Java for execution depending on sensitivity to slippage.
The answers also mention array languages, functional languages, and event-processing tools, illustrating that firms may combine technologies rather than choose one language for everything. The evidence is largely historical job counts and individual anecdotes, with competing views about which languages dominate. It is not a current, systematic industry survey, and the document offers no controlled performance comparison; its practical lesson is to consider data access, numerical libraries, speed, team skills, and the task being built.
Key ideas
- Quantitative finance teams often use different languages for data infrastructure, research, and execution.
- C++ and Java are described as common options for infrastructure and vendor connectivity.
- MATLAB, R, and Python are presented as tools for research and prototyping.
- One account combines MATLAB research with C++ functions to accelerate backtesting.
- Language prevalence claims rely on dated job counts and personal reports rather than a systematic current survey.
Tags
Full text
# What programming languages are most commonly used in quantitative finance? # What programming languages are most commonly used in quantitative finance? What programming languages are the most common in quantitative finance, and why are these languages used? Note: I do not mean, what languages are used to develop the accounting system at a hedge fund: this is specifically related to aspects of valuation and trading. ## Answer by Lepto Kurtič (score 30) https://quant.stackexchange.com/a/1509 Searching http://www.quantfinancejobs.com for - "C#": 62 jobs, 54 (2011) - "C++": 209 jobs, 236 (2011) - "Java": 72 jobs, 121 (2011) - "VBA": 35 jobs, 20 (2011) Searching http://www.quantcode.com/modules/jobs/ for - "C#": 228 jobs, 277 (2011) - "C++": 696 jobs, 813 (2011) - "Java": 291 jobs, 328 (2011) - "VBA": 157 jobs, 190 (2011) ## Answer by chrisaycock (score 29) https://quant.stackexchange.com/a/312 A choice of C, C++, or Java is practically required somewhere in the stack since most data vendors only supply bindings for one of those languages. Once the data arrives, though, the trading desk can use whatever it wants. In addition to the above three, I've seen these used in production: - Visual Basic / Excel - q / kdb+ - R - Python - MATLAB - OCaml I've also seen Flex and AJAX used for some front-end components. And finally, some firms build their own in-house proprietary languages. Goldman Sachs famously has Slang. Related question: What language should I use in quantitative finance? Related answer: - Whatever your boss pays you to use. - At least one of the "Big Three" above to get the data feed. - If you actually do get a choice, whatever you feel most comfortable using. As per #3, that's why you'll notice most language choices are either mathematical in nature (like R and MATLAB) or very high-level in nature (like Python and OCaml). ## Answer by gappy (score 13) https://quant.stackexchange.com/a/316 I believe that C++ is the most common quantitative infrastructure language. I don't know of a single hedge fund or investment bank that doesn't use it extensively or completely (and I spoke to a lot of them at some point in the past). In some cases, as the former Lehman brothers-now-Barclays, C++ was the only language of choice, which is a bit extreme, given that C++ is not as easy to use as a scripting language. Most companies I know pair C++ with a scripting language of choice. Traditionally, this was MATLAB, which is still amazingly popular for prototyping. More recently, R and Python have become more popular. R especially is now used at several hedge funds I know, and has taken many MATLAB seats; and I know of Python users in JPM and UBS. Python has also nice bindings to BLAS, LAPACK, NAG and MOSEK. Goldman has diffentiated itself by developing a proprietary language, SLANG; the very definiton of non-popular. I don't think Java is used heavily or at all for numerical work. Just try to find maintained to BLAS and LAPACK. Some crazy market maker will differentiate itself via language, as in the case of Jane St., lonely user of OCAML. I would not be surprised to find a LISP-only 10-person shop flying under the radar screen, and very wealthy. But I have never heard of a single Clojure/Scala/Groovy/Ruby/[add your trendy language] in a serious company. At least, I would never invest my money in a company using a web development, immature language to manage wealth. Summing up, I would say C++, and then a number of prototyping languages, with MATLAB still dominating, but R having a strong positive momentum. ## Answer by Steve Severance (score 13) https://quant.stackexchange.com/a/477 F# was used at credit suisse and I believe a number of other desks. From people I know at Microsoft the banks told MS to make it a supported language, otherwise it would have stayed a project at Microsoft Research. I have also seen Haskell used for derivatives trading. ## Answer by jordan.baucke (score 10) https://quant.stackexchange.com/a/1546 #### I recently did a 'Poll' on 'LinkedIn' about this topic that got 160 votes and generated some great conversation on this subject. http://linkd.in/gHNOgt (Poll Results: Java won out) I realized after the fact that I should have structured the question more specifically" Ultimately, depending on what component of a trading system you are tasked with building (back office, front office, messaging system, quant. analysis, etc.) different technologies do things better than others, and there is no 'One Size Fits All' Interestingly, if you look at the 'age' demographic of the respondents, C/C++ was typically those whom were a bit older 30+, while the younger generation tended toward Java, F# (OCaml), Or Python. Also, it's important that many programmers whom have mathematical backgrounds tend to find 'functional' languages more useful as opposed to 'imperative languages'. Both have their pro's and con's, but remember: functional languages tend to compile into faster byte-code, but maybe harder to adapt to newer technologies for the web. For my part, I'm writing a limit-order-book in F#, Scala (Functional Java), and Python, and am going to study the results. http://www.opensourcetrader.com ## Answer by olaker (score 8) https://quant.stackexchange.com/a/317 Let me quote a few excerpts from Paul & Dominics Guide to Quant Careers (version 2.0): > Most quant jobs ask for C++, with much smaller demand for C# and Excel VBA and Java. Although Excel is the second most common skill, alas Excel VBA is regarded as “trivial” so few employers will be impressed by mastering it. This attitude is responsible for major efforts at the large banks to defuse the vast number of actively disruptive, yet critical spreadsheets that enjoy the reliability of a British train... Some quants get sucked into roles that we call “Excel Jockeys”. Although some Excel work is cutting edge trading floor work that makes money every time you get the sheet to work properly, the majority is looking after risk reports, data ingest and sheets that even users don't know why they have. MatLab is common in both academia and finance, and it does not harm to have used it, but again like Excel VBA the view amongst managers is that if you are smart enough to do real quant work you can pick up whatever MatLab you need though we do see a few jobs for extreme high end MatLab gurus. Fortran is still quite popular in academia, but has only a tiny market share in banks... Much “C++” code in banks is really much like C, and one does see “C++” code that is written using the C subset but trying to be like Fortran. ## Answer by Marko (score 7) https://quant.stackexchange.com/a/460 C++, Java, Ocaml Very good link for further information: http://www.selectorweb.com/algorithmic_trading.html ## Answer by TheBridge (score 6) https://quant.stackexchange.com/a/343 I use C# ( and more generally .Net Framework) Regards ## Answer by Beer4All (score 4) https://quant.stackexchange.com/a/1510 It is true that C++ is oftenly required in jobs advertising but for me it is as a pledge of programming knowledge. Now, in my opinion C# use tends to become the next standard over the next few years in the quant industry. I see two reasons for that, - from a programming point of view, C# is very mature programming language AND does (natively) offer a plenty of very interesting possibilities such interaction with databases, excel, real time application, GPU programming .. and the transition for a C++ programmer is incredibly easy, - the number of high end numerical libraries available in C# ## Answer by alpha (score 4) https://quant.stackexchange.com/a/3153 Java is the king! i have done both C++ and Java. I have met two crowds: - C++ gurus who turned Java Gurus: they all admitted that after knowing Java; they will never go back to C++ again. Although their code in Java was a bit clumpsy..:) - C++ gurus who don't know Java; and don't want to know about it I personaly will never ever ever do C++ again. ## Answer by Scott Weinstein (score 3) https://quant.stackexchange.com/a/496 I've seen the following languages in use: - C++ - C# - Excel (VBA) - F# - Q - MatLab - R - Python ## Answer by Bob Armstrong (score 3) https://quant.stackexchange.com/a/1293 For a lot of complex Financial applications , the Array Programming Languages virtually have a monopoly . Check out the APLs from IBM , Dyalog , APLnext , and the variants J and Kdb ( Q ) . Python , R , and Matlab have implemented a number of ideas from the APL tradition . Morgan Stanley continues to use Arthur Whitney's ( the creator of Q , nee K ) A+ . SmartArrays has a library , interfaced to most standard languages and operating systems , implementing the essential array functions abstracted by a couple of the implementers of the most prominent traditional APLs ## Answer by Michael Teo (score 3) https://quant.stackexchange.com/a/1508 For empirical researching, we used MATLAB for the ease of implementation. We coupled with some C++ functions for the speed of backtesting in MATLAB. We tried Excel, VBA but its too slow for processing a huge amount of data. For execution, it will depends if the strategy is sensitive to slippage. If high speed execution is required, C++. If not, Java is what we preferred. ## Answer by John Channing (score 3) https://quant.stackexchange.com/a/1591 C++ is used everywhere. There is some interest in function programming languages, like Haskell, which are a good fit for mathematical modelling but there are numerous issues with performance and memory consumption which limit usability. From experience, the talent pool is also not very deep when it comes to functional programmers, so building and sustaining a team of quant developers using a functional language is difficult. ## Answer by goric (score 2) https://quant.stackexchange.com/a/323 To add some languages I've seen used that I don't see in any responses yet: - SAS for statistical analysis - Perl, as a general purpose scripting language - Mathematica, as a possible alternative to MATLAB for mathematical scripting - C# or any other .NET language, used in similar capacities as Java would be ## Answer by Tal Fishman (score 1) https://quant.stackexchange.com/a/1487 Has anyone else here ever used Stata? It's probably closest to R and Matlab. Like both R and Matlab, it is remarkably flexible and has many good built-in routines for the standard statistical techniques and a decent-sized community contributing code for some of the less popular techniques. Like Matlab but unlike R, it is very well documented with clear and simple examples and very easy to use and pick up, yet it is much cheaper than Matlab. For at least one hedge fund I know of, it has substituted well as a cheaper alternative to Matlab for strategy research and development. ## Answer by Andy Flury (score 0) https://quant.stackexchange.com/a/8217 Besides all the procedural languages mentioned above I would also strongly vote for Complex Event Processing (CEP) and its programming language EPL (similar to SQL). Time-based Market Data Analysis and Signal Generation are coded in EPL statements, whereas procedural actions like placing an order are coded in plain Java Code. The combination of the two provides a best-of-both-worlds approach and accommodates strategies that are predominantly time-based and therefore cannot be programed with traditional procedural programming languages. Esper is an Open Source solution in the CEP area. AlgoTrder is an Algorithmic Trading Framework based on CEP and Esper. AlgoTrader is a Java based Algorithmic Trading Platform that enables development, simulation and execution of multiple strategies in parallel. The automated Trading Software can trade Forex, Options, Futures, Stocks & Commodities on any market. There are two versions available of AlgoTrader: - An Open Source Version that you can download for free - A Commercial Version (with Support and Professional Services)
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.