Live data from Hacker News

We chose Java for our high-frequency trading application

medium.com

191–200 of 287 posts

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

#191
post #7

There's a major historically-contingent component to this, too. The Island ECN, later absorbed into NASDAQ's ECN, originally ran its matching engine as one of these low-latency Java processes, writing everything using explicit object pools to avoid doing any GC on the critical path, as this was long before Zing was around. This was a pretty reasonable choice at the time, as this was long before C++11 was around, and…

[deleted]

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

#192
post #106

Earlier quoted context omitted.

What sort of targeting do you use for your campaigns, and how privacy-violating are those targetings?

If you have to ask the question I would encourage you to take $50, open a FB ad account, same for Google, and run some ads to drive some traffic to your blog or whatever. Running an ad campaign, or having to 'get the word out' for something possibly meaningful can be an enlightening and transformative experience for so many people who live adjacent to, but otherwise 'totally outside' the ostensibly opaque world of ma…

Lol, I work in adtech.

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

#193
post #25

What's the upper salary cap for HFT engineers. I'm talking cash , not stock. From what I've seen above 200k is exceptionally rare.

I work in HFT and base comp is pretty much irrelevant. In fact at the firm I work at, every single employee gets the same base salary (low 6 figures). Not that's not important: everyone makes way more money through their part of profits depending on their equity and their amount invested in the fund.

Total cash compensation easily gets above 400-500k. People probably make less money at large firms, tho.

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

#194

A sting of nostalgia and coincidence perhaps, was thinking about Java and HFT only a few days ago. I worked as an offshore employee for E*Trade back in 2010 - 2012. Their desktop app for HFT was written in Java Swing and their web client too was running on the JVM but the 'services' layer the one that interacted with the database was written in C++. Four years ago heard that they were re-writing the desktop app in Ja…

What do you mean their desktop app for HFT? no one has HFT desktop apps

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

#195
post #113

This is off tangent, I am surprised that the largest of FAANGM companies aren't trying to muscle into HFT or Quant industries. It seems right on their wheelhouse: highly technical and makes a lot of money.

Well, Apple has Braeburn Capital but they're probably much more risk-averse.

https://en.wikipedia.org/wiki/Braeburn_Capital

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

#196
post #188
post #44

Earlier quoted context omitted.

> if it was universally good as it's written, they would have essentially solved one of the major problems not just for Java, but for a large amount of languages. In a way, low-latency GCs like C4 and ZGC have done that, but implementing them requires a large and experienced team, and not many languages even try to target high performance to begin with.

I'd like to see C4 be put up against ZGC.

ZGC is not yet generational (it will be), so I expect C4 to hold up better to very high allocation rates.

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

#197
post #183

Earlier quoted context omitted.

We have written a database in zero GC java and one thing I have not seen any evidence of "escape analysis". @State(Scope.Thread) @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public class EscBenchmark { Rnd rnd = new Rnd(); public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(EscBenchmark.class.getSimpleName()) .warmupIterations(5) .measu…

Which version of Java are you using? And what is Rnd? The class included with JDK is Random. We rely on escape analysis to elide such object creation for us and it works reasonably well. If something this trivial doesn't work for you, file bug with them. We have had success with that as well.

This ran on Java 11. This isn't so much of an issue for us. We are trying to avoid allocations, even as trivial as those. There are other examples that allocated where they should not, for example this lambda will allocate.

  () -> System.out.println(1)
I lost hope in escape analysis quite frankly.

Rnd is something I have written because Java's Random is slow and clunky.

https://github.com/questdb/questdb/blob/master/core/src/main...

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

#198
post #55

Earlier quoted context omitted.

> 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 trades and vice-versa there's barely any point in being ultra-fast in the "non-speed-critical" bucket because your alphas last for minutes to hours. Depending on the overall strategy, you can be smart and fast at once. If you have occasional alpha harves…

I think he means smart as in "how long your model prediction takes". If your neural net (haven't actually met anyone who uses these in trading) takes 5ms to make a prediction that'll lock you out of a whole lot of trading opportunities/strategies. Speed always matters, no matter where on the smartness spectrum you are, but it's relative. If your model prediction takes 5ms you're not getting much ROI out of investing…

> If your neural net (haven't actually met anyone who uses these in trading) takes 5ms to make a prediction that'll lock you out of a whole lot of trading opportunities/strategies.

Let's say you have trading opportunities once every 100ms. They need to be acted upon within 2ms or they vanish.

You don't have the time budget to run a NNet every time the state of the market changes. You can, however, train a NNet to output a very small decision tree that can run in under 1ms. The NNet can then decide which "micro-strategy" in the form of a much faster and more reactive decision tree is more appropriate for the current market context.

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

#199
post #169
post #133

I had to laugh at one line. PHP or Perl are called interpreted because the interpreter (installed on the destination machine) compiles each line of code as it goes. Yeah, that hasn't been true of most "interpreted languages" in decades. The most common interpreted languages that I can think of where you parse as you go are shells like bash. Languages like Perl and PHP are called interpreted because an interpreter run…

The PHP Wikipedia page seems to argue that the most popular implementation, Zend, is an interpreter. https://en.wikipedia.org/wiki/PHP#Implementations

It argues that it operates as an interpreter, in exactly the way that I described.

From your link, The Zend Engine compiles PHP source code on-the-fly into an internal format that it can execute, thus it works as an interpreter. In other works at startup itreads code, compiles to an internal form of byte code, and from then on it executes that. So it works as an interpreter (you give it code, it runs). But internally it does not go line by line as you go.

As a simple demonstration, a syntax error on line 10 of a PHP script will keep it from executing code on line 5. By contrast a syntax error on line 10 of a Bash script will not keep it from having executed line 5 first.

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

#200
post #193
post #25

What's the upper salary cap for HFT engineers. I'm talking cash , not stock. From what I've seen above 200k is exceptionally rare.

I work in HFT and base comp is pretty much irrelevant. In fact at the firm I work at, every single employee gets the same base salary (low 6 figures). Not that's not important: everyone makes way more money through their part of profits depending on their equity and their amount invested in the fund. Total cash compensation easily gets above 400-500k. People probably make less money at large firms, tho.

Thanks for the tip ! . I'm eyeing an early retirement, so I'd like to live off 100k and save the rest.

Would you consider your job high stress ?

Post reply on HN