Forums  > University  > Developing C++ knowledge for HFT  
     
Page 1 of 1
Display using:  

mrdivorce


Total Posts: 13
Joined: Jan 2017
 
Posted: 2017-01-18 00:42
I was recently rejected for a quant/dev role at an hft firm, ostensibly because my C++ wasn't up to snuff. I want to rectify this but am unsure how to go about it, as I'm very ignorant of the field and am having trouble finding transferable books and problems to work on.

I've had a couple of ideas of what might help:
- Getting a grip on concurrent C++. I've been reading the Anthony Williams book https://www.amazon.co.uk/C-Concurrency-Action-Practical-Multithreading/dp/1933988770.
Coding up some ML models in C++ might be good practise for concurrency (with potential GPU involvement)

- Coding an OS? Possibly far too ambitious but I imagine it'd be perfect for getting to know the low level lay of the land. I found an interesting book which attempts something fairly simple at https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf.
There's Minix out there too for more gnarly challenges https://www.amazon.co.uk/Operating-Systems-Implementation-Prentice-Software/dp/0131429388

It seems like the OS/systems programming path might be the most appropriate. If anyone has any books/project suggestions which might help hone the necessary low latency/low level C++ craft then I'm all ears!

darkmatters


Total Posts: 74
Joined: Nov 2010
 
Posted: 2017-01-19 18:23
Did you try asking them for feedback? Sometimes they will actually give it, which will help you improve.

Concurrent C++ might be a good start.

mrdivorce


Total Posts: 13
Joined: Jan 2017
 
Posted: 2017-01-21 16:56
Their feedback wasn't too specifc, just that my C++ let me down. I held off asking what flavours they were looking for in particular but will give it a go. Certainly concurrent C++ sounds like a necessary skill. Thanks for the suggestion

pj


Total Posts: 3510
Joined: Jun 2004
 
Posted: 2017-01-22 07:51
@ mrdivorce
It sounds like generic refusal. Try to get more info.
The real reason may be more mundane. Like the guys
didn't like your suit.

The older I grow, the more I distrust the familiar doctrine that age brings wisdom Henry L. Mencken

indiosmo


Total Posts: 17
Joined: Jun 2011
 
Posted: 2017-07-18 14:32
Agner Fog's website has tons of stuff on optimizing C++ code.
Optimization Manuals

While you should have a good understanding of concurrent programming, I don't think that's the main concern in HFT.
The critical path should (to the extent possible) usually run on a single thread to avoid the cost of context switches and having to copy stuff around anyway, so more important is understanding memory access patterns and choosing the right data structures.
Anything not critical can be passed to other threads to be processed asynchronously.

Understanding the underlying OS is also important, you should know how interrupts and the scheduler work for example, but you shouldn't need to code an OS for that, just google those terms and go down the wiki links.

Redhat has some stuff on tuning the OS for low latency as well (https://access.redhat.com/sites/default/files/attachments/201501-perf-brief-low-latency-tuning-rhel7-v1.1.pdf).

VIXtrick


Total Posts: 6
Joined: Mar 2020
 
Posted: 2020-03-24 02:14
.

doomanx


Total Posts: 70
Joined: Jul 2018
 
Posted: 2020-03-24 08:41
@VIXtrick I totally disagree with the second part of your statement, it reads like those guys on Quora who've never worked in the industry. We're talking about development here; All the best HFT programmers I've worked with were classic tinkerers who loved hacking weird old com64s and such. It's all about deep knowledge of hardware, networking and the compiler, not really about abstract problem solving skills. For my development team I'd take a guy with 10 years C++ in a heartbeat over some IMO type character. Smarts will help, but the most important thing is serious dedication to computers far beyond what you learn at university or any regular software development job.

If you'd like an idea of how the actual day to day job looks, Matt Godbolt (ex DRW and the guy who built compiler explorer, a tool I used most days back when I actually wrote C++ myself) made some videos live-optimising some C++ https://www.youtube.com/watch?v=fV6qYho-XVs. Here's another great talk by Carl Cook, Optiver https://www.youtube.com/watch?v=NH1Tta7purM.

EDIT: last one I'd add, a genuinely amazing entrepreneurial story too https://meanderful.blogspot.com/2018/01/the-accidental-hft-firm.html

did you use VWAP or triple-reinforced GAN execution?

Jurassic


Total Posts: 348
Joined: Mar 2018
 
Posted: 2020-03-24 10:41
@Doomanx those guys on Quora are bad!

VIXtrick


Total Posts: 6
Joined: Mar 2020
 
Posted: 2020-03-25 03:06
.

Strange


Total Posts: 1644
Joined: Jun 2004
 
Posted: 2020-03-25 03:34

@doomanx "It's all about deep knowledge of [stuff], not really about abstract problem solving skills. "

I would venture that anything in buy-side finance is tinkering and specific, detailed knowledge, not about high mathematics or abstract reasoning.

'Progress just means bad things happen faster.’

doomanx


Total Posts: 70
Joined: Jul 2018
 
Posted: 2020-03-25 08:33
@Strange I'm a big believer in that point too. Abstract problem solving skills help you narrow down the search for who might be good (say for the most junior positions), but when money is on the line you just want people that know how to generate revenue.

@VIXtrick All good steps, learning those tools will be helpful. If you want to start working on a toy distributed trading system, I would recommend getting started with a low latency networking package like ZeroMQ (have used this in production before, you can get really good performance out of it). For an idea of the architecture of a distributed system (not quite a trading system, but there's a lot of similarities) take a look at https://martinfowler.com/articles/lmax.html. Have a google around for low latency FIX engines too - this should lead you to read about UDP and such, which is the protocol you will get data from most exchanges in. There are several proprietary options like OnixS but an UHFT shop will usually have something in house.

As for resources, the #1 resource I remember (and has already been mentioned a couple of posts below by indiosmo) is Agner Fog's stuff, for example https://www.agner.org/optimize/optimizing_cpp.pdf.

did you use VWAP or triple-reinforced GAN execution?

mrdivorce


Total Posts: 13
Joined: Jan 2017
 
Posted: 2020-03-25 10:54
@Indiosmo a very belated thank you for the links, I posted this before I figured out I was able to be notified of replies hence the delay :)

Along with the material others have posted, I fully recommend Martin Thompson's blog posts at https://mechanical-sympathy.blogspot.com/. I believe he worked on the LMAX exchange that @doomanx mentioned, and although it's a bit old now the blog is full of awesome low-level wartiness without going too far into the weeds.

(edit/warning: the blog contains mostly Java but hopefully that won't totally ruin the fun)

VIXtrick


Total Posts: 6
Joined: Mar 2020
 
Posted: 2020-03-29 19:47
.

doomanx


Total Posts: 70
Joined: Jul 2018
 
Posted: 2020-03-29 22:51
@doomanx sorry maybe my messages got a bit mixed up there - wouldn't really use zmq for udp stuff, most useful is the tcp and inproc functionality. Get a good understanding of the different patterns pub/sub, rep/req, broker/dealer etc.

did you use VWAP or triple-reinforced GAN execution?

VIXtrick


Total Posts: 6
Joined: Mar 2020
 
Posted: 2020-03-29 23:33
.
Previous Thread :: Next Thread 
Page 1 of 1