Member-only story

Code & Capital: How C++ Turned a Market Squeeze into a $200k Win

Luiggi Trejo
3 min read6 days ago

--

Photo by Behnam Norouzi on Unsplash

As a seasoned high-frequency trading (HFT) trader and scientist, I’ve found that the “best” programming language for trading hinges on my specific needs — whether it’s the type of trading I’m doing, the performance I require, or how comfortable I am with the language. I’ve weighed the options, and here’s how I see it.

I consider Python a standout choice because of its simplicity and readability, paired with an ecosystem of libraries that fit my needs perfectly. With pandas, I handle data analysis effortlessly; NumPy powers my numerical computing; and TA-Lib gives me the technical analysis tools I rely on. For backtesting, I turn to backtrader or Zipline, which let me prototype strategies fast. It’s my go-to for algorithmic trading and quantitative work, especially when I’m blending in machine learning. The tradeoff? I know it’s slower than compiled languages, which can pinch me in HFT where every microsecond counts.

When I need raw speed, I lean on C++. Its efficiency and control over system resources make it my top pick for latency-sensitive systems. I’ve built low-latency setups with it, and it’s a beast for HFT — exactly what I need when I’m competing at the professional level. There was this one time C++ genuinely saved my day. I’d been running a Python-based HFT system for a new arbitrage strategy —…

--

--

Luiggi Trejo
Luiggi Trejo

No responses yet