Hi folks,
I notice many algo traders (better ones) write their algos in Java/Kotlin. I wonder if there are advantages of Java over C#, Go or other langs for algo trading? Also, is Linux really better for trading setup than Win?
My backtesting engine and trading logic are written in scripting language (almost finished now, not running live yet). Im curious as to whether I'm missing on smth by not using Java/Linux setup.
I would appreciate if somebody could educate me on this.
@FreeGoldRush @ValeryN , if you guys could also chip in on this discussion, I would be grateful.
There are many generic reasons to prefer Linux over Windows for general servers or workstations, which is a debate that has been around for decades and pointless to rehash here. But specifically for trading:
- Plenty of UNIX utilities with widely shared and public resources on their use cases. To name a few:
- tcpdump for debugging connectivity issues
- telnet for testing wire protocols
- PTP daemons like ptp4l for time synchronization
- taskset to bind application to specific CPU cores
- turbostat to check CPU frequency
- netperf for measuring network performance
- ssh out of the box with most distros for remote access
- Easy to configure for performance, e.g. kernel parameters for lockup thresholds, overriding of BIOS C-state settings, wake-up preemption granularity MCB polling.
- Frequent releases of kernel support for features like hardware clocks etc.
- Open kernel source makes it easy to understand performance and patch parts for optimizations.
- Accessible documentation and guaranteed compatibility with tools, libraries and drivers etc., e.g. for RDMA, userspace networking, commercial messaging frameworks.
As for the preference for Java, I think it is mostly a social one. Java was dominant around the period of peak growth for electronic trading, so naturally many top latency and performance engineers in the space had Java experience and there are now many public resources (guides, open source projects) which make it easy for you to piece together a trading system in Java.
Java also had better cross-platform support than C# (.NET-based) before Microsoft put their weight behind Mono. And compared to many languages, it had mature desktop GUI development frameworks. Many firms evolved from a front office environment with Windows desktops to support Bloomberg, Excel spreadsheets and manual traders, and so Java adoption helped maintain a unified code base for both their server applications and desktop GUIs.
You'll probably find a higher density of people working in electronic trading firms when attending a C++ meetup than a Java meetup in Chicago though.