# Types of programming languages used for optimization in finance

I'm currently taking graduate finance courses, and wish to pursue a career in finance - in particular $\textbf{optimization in finance}$. To date, I've only been taught the GAMS programming language (some models can be found at: https://www.gams.com/latest/finlib_ml/libhtml/index.html).

I've looked up What programming languages are most commonly used in quantitative finance? but found no other programming language that solves optimization problems in finance. Are there any other possible programs I can pick up which are still relevant in the industry?

• I believe this question will be closed as off topic but for what its worth most of this is done in general purpose programming languages in industry. As far as I have seen in terms of my work and from job postings these will be R, python, C++ & java. Some places also use Haskell or Scala and I've heard of places using Matlab. They are all as good at solving optimization problems as the programmer. – MD-Tech Nov 3 '17 at 11:03
• I would learn R and C++ if I were going to try to get to where I am now. – MD-Tech Nov 3 '17 at 11:06
• I use C#, Java, Python, and VBA. As mentioned above though, the languages are only as good as the developer. You will find lots of strong opinions and attitudes within the programming world though...It's as if an arrogance course is a prerequisite nowadays. – amdopt Nov 3 '17 at 13:53
• FWIW I use python not because I believe it to be the best optimising language (R, c++, MATLAB etc. can all implement the required algos as other have said) but because I find it easier to manipulate the inputs and outputs in a user interface, or for example with web interaction. – Attack68 Nov 5 '17 at 15:00
• Most of the optimization routines out there are written in Fortran/C/C++. Languages like R and Python typically call these Fortran/C/C++ libraries. You can write an optimization function in just about any languages. What has the best performance? Fortran/C/C++. However, it can be more productive in higher-level languages like R/Python. – John Nov 10 '17 at 3:44

## 1 Answer

I think it depends on the size of your organization/team, since for smaller organisations you would need to manipulate your variables and input data much more than larger ones, and therefore would need something more nimble like Python. More enterprise level, which generally have predefined data tables and teams/tools, teams would prefer you work with C++ or Java as a programmer, with the rare C#

I prefer to work Python which, although is definitely not the fastest language, it is the most portable and allows more dynamic manipulation/preprocessing/fetching, and most well-defined mathematical optimisation problems have been implemented with Python APIs. Plus Jupyter Notebooks allows for very visual and iterative coding for analytical work.

However, you would be hard-pressed to find specific optimisation scenarios and would likely require you to implement that logic. For example, you can execute a number of Mean-Variance optimisations by configuring CVXOPT solvers (http://cvxopt.org/userguide/index.html) in Python, such as creating a hedged portfolio, but you would not find readily available (and free) 'Selective Hedging' optimisations, pre-implemented outside of GAMS.

• Thanks for such a clear breakdown! I shall explore the above languages one at a time, and also test them out. :) – Stoner Nov 11 '17 at 20:15