2

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.

vpy
  • 187
  • 1
  • 9
  • 1
    Is it perhaps not the case that they do use Python for these purposes, but as a quant at a trading firm you are expected to be able to both do data wrangling and machine learning and maintain and expand about infrastructure C++ code? – Oscar May 07 '20 at 07:02

3 Answers3

1

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.

Martin Vesely
  • 781
  • 1
  • 5
  • 23
  • 1
    Thank you for your reply. Do you know of any book that explains how to use C++ for Data Science? – vpy Apr 17 '20 at 05:02
  • @vpy: I do not use C++ much in work, so I cannot give you reference to a blok but try to Google C++ for data science book. There are some links to Amazon. – Martin Vesely Apr 17 '20 at 07:58
  • 1
    @vpy More so quantitative finance than data science but I like the book C++ Design Patterns and Derivatives Pricing by Mark Joshi quite a lot. Very accessible book on C++ for people with a background in financial mathematics. The book is more so about implementing efficient, clean and reusable code, so probably more about building up infrastructure than testing out algorithms. – Oscar May 07 '20 at 07:01
1

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.

vpy
  • 187
  • 1
  • 9
1

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.

chrisaycock
  • 9,817
  • 3
  • 39
  • 110