Why HFT Researchers May Need C++ Alongside Python
Summary
The document explains why C++ skills can matter for quantitative researchers at high-frequency trading firms even when Python is more convenient for exploration, data analysis, and machine learning. It distinguishes research modeling from work that interfaces with a firm's trading infrastructure and production systems.
The responses say Python may be sufficient for model research at some firms, while others expect researchers to use C++ APIs to process detailed order-book data and collaborate on deploying signals. Compiled languages can also support performance-sensitive systems, and scientific computing libraries are available in C and C++. These are practice-based explanations rather than a general requirement: firms differ, and some provide Python wrappers around their data systems. The discussion does not compare languages quantitatively or establish that C++ improves research results.
Key ideas
- Python can be sufficient for model research when the task is separated from trading infrastructure.
- Some firms expect researchers to use C++ APIs to access and aggregate detailed market data.
- C++ knowledge can help researchers work with engineers when moving signals into production.
- Compiled languages are common in performance-sensitive trading systems, but research workflows vary by firm.
Tags
Full text
# Why is C/C++ used by researchers to develop and test algorithmic trading strategies? # Why is C/C++ used by researchers to develop and test algorithmic trading strategies? I understand why compiled languages such as C/C++ are important for low-latency trading infrastructure. But I am curious why even researchers at the high-frequency trading firms also require a strong mastery of C/C++? Isn't Python (with the numerous strong packages such as scikit, pandas, etc) a better language for data exploration, data wrangling, machine learning and subsequently to quickly test out algorithms? How are these tasks achieved in C/C++? Advance thanks for your time and help. ## Answer by chrisaycock (score 1, accepted) https://quant.stackexchange.com/a/54193 Plenty of HFT shops do not require C++ from the quants who are only involved in modeling. As you hypothesize, Python is sufficient for researching models. Your friend may simply be at a place that values tighter integration between research and engineering. Other shops will just have a Python wrapper to fetch historical data, obviating the need for C++. (I personally handled both research and development in my day, so I wrote all the Python and C++ code anyway. My experience is not common.) As mentioned in a comment, there is C++ Design Patterns and Derivatives Pricing by the late Mark Joshi. And there are other books recommended in this answer. ## Answer by Martin Vesely (score 2) https://quant.stackexchange.com/a/53358 C/C++ are low level languages in comparison with Python. Moreover, Python is scripting language. By nature, scripting languages are slow becuase they have to be interpreted. As there is a requirement for the highest possible performance in HFT, compiled languages are natural choice. Concerning libraries, there is also vast amount of maths libraries for C/C++ as these (mainly C) were historically used in scientific research. ## Answer by vpy (score 1) https://quant.stackexchange.com/a/53923 I was able to reach out to a friend working at a HFT place as a quant researcher. It appears that C++ knowledge is key to interact with the infrastructure (which is all written in C++). For example, when trying to conduct a research on Level 2 data, researchers are expected to know C++ to be able to use the C++ APIs to aggregate the relevant order book data into a csv format etc, and from there, the researchers can use Python (read the csv and conduct any analysis using scikit learn etc). And when pushing a signal into production, again its necessary for researchers to know C++ to be able to work effectively with engineers to deploy the signal.
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.