I am debating which language to use to write the trading code for the FIX protocol of our broker which Lime. Can someone please share some insights? Thanks! https://www.dollarsandsense.sg/5-pr...ou-should-know-if-you-are-an-aspiring-trader/
If you already have experience in either language, pick whatever you're most familiar with. Iterate fast and build something that works first, then optimize for latency later. All else equal, and you're starting on a blank slate (I hope not), I generally recommend going with C++ for this. The reason is that there's a lot more ancillary benefits rather than language-specific benefits: - Many decently written, open source examples of data structures that you'll need. - More relevant vendors have C/C++ client libraries or tools than Java client libraries, e.g. VHDL transpilers. - The C/C++ client libraries tend to be better maintained than Java client libraries for such vendors, e.g. Alphaflash, Quincy, Celoxica. - Easier to apply your knowledge towards C drivers or devices with lower level APIs, e.g. ef_vi, onload.
If you're in a colo where you need nanosecond tick-to-trade times, then C/C++; otherwise Java/Kotlin.
Thank you for sharing your insights. I have a follow-up question: Besides, my current code is written in Python. Before I am able rewrite everything in C++, what is a good way of coupling my current Python algorithm code with the future C++ code that communicates with the broker, e.g. placing/cancelling orders and getting account status. For example, if my python code decides to purchase 1 share of stock AAPL, it sends the command the C++ daemon. What is a good way of doing this? I can think of redis or rabitmq.
C++ and python is interoperable. If you have done commercial level c++ programming in this domain, most likely you will be famiiar with boost. Use boost.python for this.
This is called "Binding." [1] In my last job we used Boost.python [2]. I haven't personally used them, but other options for static binding include SWIG [3] and SIP [4]. Dynamic binding, there's cppyy [5]. The annual C++ "Cppcon" conference is just finishing up; I've been soaking up talks all week as an online attendee. there was a talk that touched on this. I can forward if you like. [6] 1. https://en.wikipedia.org/wiki/Language_binding 2. https://www.boost.org/doc/libs/1_75_0/libs/python/doc/html/index.html 3. http://www.swig.org/ 4. https://en.wikipedia.org/wiki/SIP_(software) 5. https://cppyy.readthedocs.io/en/latest/ 6. https://cppcon.org/program2021/
See attached for a few key slides. The presentation did not focus on bindings; it was about interactive compilation (compiled C++ as you type) as a tool for Data Science, but static and dynamic binding were needed and explored as a subset of the presentation. Credit: Vassil Vassilev, Princeton University, New Jersey, USA. Cppcon 2021.