Live data from Hacker News

We chose Java for our high-frequency trading application

medium.com

81–90 of 287 posts

Re: We chose Java for our high-frequency trading application

#81

I think I actually saw these folks present at JavaOne a couple years ago? Either that or there's more than one shop branding itself as "HFT" that uses Java. I worked in the industry and it's always a little funny to see who calls themselves HFTs vs quants. Basically, there's a bit of a spectrum of fast vs smart. In general it's hard to do incredibly smart stuff fast enough to compete in the "speed-critical" bucket of…

Nice overview. The fast vs smart comparison is apt. But something that gets missed in these conversations is what trading system architectures actually look like. The part where latency is measured in nanoseconds is just the tip of the iceberg. Java and 2007 tech is absolutely acceptable for most of the architecture.

Another thing is the structure of Equity and Derivative markets vs FX. The former is fairly standardized. You'll need infrastructure at a handful of exchanges in 2 or 3 cities. Microwave networks and FPGA's are the norm.

But for FX markets, where these guys trade, the picture is much more messy. There are countless places to trade. Co-location means different things at all of them. The entire structure is much less regulated and understood. As a result, strategies and trading system architecture looks much different.

Re: We chose Java for our high-frequency trading application

#82
post #63

I have a question: When i finished my theoretical Physics PhD, HFT was THE way out of academia for making money in my field. I didn't follow this path as it felt at the time a pretty evil thing to do. Does HFT provide any benefits for our society?

Some people argue that HFT provides liquidity for retail investors, but it's debatable whether that liquidity is real or not since it'll be gone during black swan events. At the same time HFT profit from uninformed/retail flow. So it's debatable wether the actual activity provides values. I'd say probably not.

But there can be indirect value in working in HFT, just like there is with other demanding jobs. There's interesting systems and ML research going on in the field - that's knowledge you can take with you and share with others. Some time ago, HFT was driving a lot innovation in networking, infrastructure, and systems.

Also, over time I've come to realize that "providing value" is really difficult to quantify. Does working in Academia provide value? Maybe if you get lucky and publish something that actually turns out useful. The majority of academics publish papers that are nothing more than noise - negative value. Does working at FAANG provide positive value to society? Again arguable. You may inadvertently end up promoting ads and misinformation. Not everyone does - but it's not guaranteed that you don't without realizing.

"Providing value" is subjective and most of the time it's nothing more than a story people tell themselves so they can feel good about themselves.

Re: We chose Java for our high-frequency trading application

#83
post #12

Earlier quoted context omitted.

There are still a number of players in the HFT space that use JVM languages. I think as with any space, if you really zoom into the details, you see a lot of diversity. You're obviously right in that people who are still hitting the CPU can't compete with people that do everything on FPGA, but it seems like there's still plenty of money to be made by people who are just a bit less fast than that. I've heard people ar…

In a info session, IMC mentioned they use Java for some of their systems.

[deleted]

Re: We chose Java for our high-frequency trading application

#85
post #26

My friend spent two years working for a large bank as a (his words) "trader's bitch". Every day the trader would request a new feature and my friend had at most two hours to implement it. They used a combination of Python and highly GC-tweaked Java. This was six years ago, but I see that similar techniques are still used to this day.

Damn, seems like a good way to have a ton of buggy code in production.

I'm guessing most people are familiar, but if you're interested in this, look up "Knight Capital flash crash". They lost $440MM in about 45 minutes. As I recall, they reused an old feature flag accidentally reviving some old code.

Re: We chose Java for our high-frequency trading application

#86
post #63

I have a question: When i finished my theoretical Physics PhD, HFT was THE way out of academia for making money in my field. I didn't follow this path as it felt at the time a pretty evil thing to do. Does HFT provide any benefits for our society?

They're part of a the market making ecosystem. That market making allows everyone to buy/sell stocks easily at the true price. HFTs make that more efficient by reducing the bid/ask spread. We had market makers before HFTs so it's not an earth shattering innovation. But it is an incremental improvement.

Re: We chose Java for our high-frequency trading application

#87

Does anyone know if C#/dotnet is used in HFT to any extent? I'd imagine proper support for user-defined unboxed types (structs) and non-hacky methods for manual memory management (unsafe) could give it major advantage over Java with much of the QoL improvements java has over C++.

I had a conversation with someone who works at Credit Suisse in IT in some capacity. He said they experiment with C# but went back to C++ due to latency. This was about 12 years ago.

Re: We chose Java for our high-frequency trading application

#88

I think I actually saw these folks present at JavaOne a couple years ago? Either that or there's more than one shop branding itself as "HFT" that uses Java. I worked in the industry and it's always a little funny to see who calls themselves HFTs vs quants. Basically, there's a bit of a spectrum of fast vs smart. In general it's hard to do incredibly smart stuff fast enough to compete in the "speed-critical" bucket of…

I discovered something amazing when working with some people who were writing HFT software. Why do you need 1TB of RAM in these machines? Because when you're Java based, you want to avoid stop-the-world GC pauses. These trading systems only have to be up from 9:30AM-4:30PM EST, so they simply disable GC altogether! At the end of a trading day, restart the app or reboot the system.

why not just use C++ or something and never deallocate memory then?

Re: We chose Java for our high-frequency trading application

#89
post #50
post #41

Earlier quoted context omitted.

Better or worse than Ad tech based companies? Most traders I've met have been fairly honest about contributing nothing to society, or that the world would probably be a better place is large segments of the finance industry disappeared tomorrow. I can't say the same for the majority of developers from Facebook or Google I've met.

??? I run ads and campaigns for my company and they are an absolutely essential form of communication. ... as almost everyone running and actual business knows. Yes - it can be very inefficient - but it's not inherently wasteful. You're making the wrong comparison - the 'Digital Ad Industry' could be compared to 'Digital Banking Industry' perhaps - i.e. useful overall but deficiencies exist. HFT is one of the ares in…

So uh, HFT is a zero-sum waste of intelligence, but paying for the privilege of shitting into people's brains to improve the chances that they waste money on garbage that they don't need is somehow positive-sum and good for society?

Re: We chose Java for our high-frequency trading application

#90
post #57

You'd think that the practice would have changed its name to low-latency trading. Anyone can trade frequently.

"Low-latency" is sometimes used as describing those who care about speed, but who are midway on the "smart fast" spectrum.

e.g. more complex algos looking at the relationship between securities

> Anyone can trade frequently.

lol, fair

Post reply on HN