Content area
Full text
G iven the increase in popularity of algorithmic trading resulting from an increase in market participants, more considerations are now required to prototype a profitable trading strategy. Trading strategies, which require optimization of parameters based on linear or nonlinear relationships, cause an increase in complexity, which in turn increases computational run time. For strategy prototyping, the choice of programming language has become more critical than ever. The goal is to have a programming language that has a simple syntax that is computationally fast and robust.
The history of academic publications of comparisons of programming languages is extensive. Prechelt [2000] produced a comprehensive comparison of C, C++, Java, Perl, and Python. The author measured productivity as a function of properties such as run time, memory consumption, program structure, reliability, and the amount of effort needed of the programmer. Prechelt showed that scripting languages such as Perl and Python are more productive than conventional languages such as C++, C, and Java.
There has not been much literature on comparisons of programming languages for investment finance purposes. However, Aruoba and Fernández-Villaverde [2014] compared programming languages applied to problems in economics. The authors had a strong emphasis for speed and compared the run time for solving an economic model called the Stochastic Neoclassical Growth Model using C++, FORTRAN, Java, Julia, Python, MATLAB, Mathematica, and R.
No literature exists on programming comparisons for investment strategy prototyping and testing, and that is where our article answers the following question: Which programming languages are most appropriate for strategy backtesting and prototyping? This question was motivated by our practical applications, for which we require our trading tools to be fast yet easy to understand. In this article, we test the run time of basic momentum strategies on EUR/USD data using Python, Cython, Julia, and C. We chose each language for a precise reason: C is known to be one of the fastest programming languages, used to implement numerical-heavy code; Python is widely used by researchers and traders; Cython promises C-like speed with the ability to be called by Python programs; and Julia is a new language that was specifically designed for scientific computing. Java and C# are very popular; however, our objective is to compare scripting languages relative to C. We find...





