1) Network layer: raw TCP sockets with binary packed messages (sometimes structs directly cast to and from raw buffers, keeping network/host byte order in mind); separate message data dictionary to avoid metadata overhead inside messages.
2) Processing: optimised C++ code; pointers; multi-threaded processes that utilise all available cores; minimal locking and contention between threads (queues with spin locks and bulk transfers); threads directly bound to CPU cores (prevent context switching overhead); prevent heap locks by allocating large object pools at startup;
3) Disk I/O: minimise disk I/O in logic-heavy, low latency threads; application level in-memory disk write queues; prefer append mode writes; application level in-memory caches (basically hash maps of reference data loaded at startup)
4) None of the "trendy" programming practices: no OOP design patterns; no dependency injection; functional programming, but without fluent APIs;
5) No popular frameworks: internally developed solutions optimised for our specific use cases, instead of off the shelf libraries or frameworks (e.g. the messaging middleware was in-house)
There is more, but this is what I could think of, off the top of my head.
This book was good https://www.amazon.ca/Advances-Financial-Machine-Learning-Ma... in that is sort of explains at a high level how you'd build a company to look at something like this (think it was one of the last chapters). You'll need extremely deep/skilled hardware/networking groups, data acquisitions (think packet capture to data) folks, people to clean and maintenance massive the data repos, internal tool teams, quantitative analysts, traders, management/admin, etc. At this level just getting the fiber to each exchange likely costs many many millions. When you go and look through those job postings you can sort of slot these into your mental model of this flow and start to see how it might be put together.
That book is good but if you are new to the topic it will be almost unreadable. At least it was for me. I had to read it 3-4 times over the years and still find new things as my knowledge grows.
I don't know if rentec is a HFT firm or what strategies they use but this was a really good interview with one of the founders https://www.youtube.com/watch?v=QNznD9hMEh0.
HFT is a combination of lots of things: low-level computer architecture knowledge, hardware engineering, computer networking, numerical computing, machine learning, super-computing, market simulation, market microstructure knowledge, risk management, financing, psychology/game-theory, etc etc.
Usually no one person is in expert in all of those areas. Usually, a firm is successful because they put together a world class team with all of those skillsets AND they’re willing to invest heavily in the right things.
And even then, it’s so competitive that you can still fail. It’s quite challenging to get everything right. There are far more ways to fail than to succeed.
I’d suggest you pick some sub-area you’re interested and focus heavily on that.
Algorithmic Trading & DMA by Barry Johnson
Trading and Exchanges: Market Microstructure for Practitioners by Larry Harris
You might also be interested in 'yummyfajitas blog:
https://www.chrisstucchio.com/blog/2012/hft_apology.html
If people have up to date replacements for these books, I'd be super interested.
If you keep asking around, people are gunnuh recommend Reminiscences of a Stock Operator, and it's an enjoyable book but keep in mind that it's basically the fictionalized biography of a problem gambler who happened to operate in the stock market, he traded recklessly and died destitute (by suicide - when you reread it, you start to notice how he never mentions enjoying anything, or talks about the people in his life in more than passing). Don't take it too seriously.
Also read up on branchless programming, lock-free data structures and avoiding heap-allocations.
Beware, the more you read about the practices of HFT firms the more some of it looks like fraud on a grand scale. For example, front running orders is a common practice that goes unpunished for HFT firms but will land you or I in jail.
I got into algorithmic trading and HFT when I was dabbling in bot trading cryptocurrencies. The wild west of crypto bot trading is pretty much gone now but man it was fun while it lasted.
In addition to the algorithmic trading books suggested I found these links helpful: https://www.quantstart.com/articles/Beginners-Guide-to-Quant...
https://www.youtube.com/watch?v=rB5jJuMP84E - just neat
https://www.youtube.com/watch?v=oUVchh37AO8
https://www.youtube.com/watch?v=bo-F61ZuBDg - 2010 flash crash
Jane Street's podcast and blog are insightful too [2]. I read somewhere that Dr. Simons (one of the founds of RenTech) has this book in his office [3].
0. https://blog.headlandstech.com/2017/08/03/quantitative-tradi...
1. https://blog.headlandstech.com/
2. https://blog.janestreet.com/ and https://signalsandthreads.com/
3. The Econometrics of Financial Markets, https://www.amazon.com/gp/product/0691043019/
Here you go:
Part 1: https://twitter.com/christinaqi/status/1670221886587047941
Part 2: https://twitter.com/christinaqi/status/1670910949921005568
Part 3: https://twitter.com/christinaqi/status/1673621133885849600
Part 4: https://twitter.com/christinaqi/status/1676135720417910784
Part 5: https://twitter.com/christinaqi/status/1677359287172231168
The main aspects are:
On the trading side, HFT is mainly about what's called "market microstructure." These are relatively simple things that are quirks or features of individual markets. Things that most people don't care about, but can make a large difference in HFT profits include when an order comes in, who gets to trade with it first? How are orders routed between different exchanges? What are the popular types of algorithms that people who place large orders use?
On the tech side:
The main is minimizing tick to trade latency. This includes using techniques as basic as colocation at the exchange's (very expensive) data centers and as involved as designing custom ASICs and anything in between like bypassing the normal network stack.
Unfortunately the real state of the art things are all closely held trade secrets, but I'd start reading the exchange data specs to start getting an understanding of the microstructure side, and you can build some of your own experiments to see how quickly you can go from tick to trade. Can you get it sub 1ms? sub 100 us? 10us?
Most of these strategies are simple in concept but extremely difficult in execution. Many of them also rely on fine-grained understanding of the exchange's internal mechanisms, things that most traders would not know or be able to figure out.
I enjoyed my time in HFT, it is a fun game to play for a while, but stressful and ultimately unsatisfying as a career trajectory unless you are making serious cash.
1. Dark Pools, by Scott Patterson, and 2. Flash Boys, by Michael Lewis.
https://www.amazon.com/Dark-Pools-Scott-Patterson-audiobook/...
https://www.amazon.com/Flash-Boys-Michael-Lewis-audiobook/dp...
https://access.redhat.com/documentation/en-us/red_hat_enterp...
On the techniques, there’s not a ton explicitly written unlike quant and statarb that have almost too much written about them. The essence is very simple though, you basically use techniques you would use in board games or casino games - look at the structure of the game itself and try to find little gaps in the rules that let you insert yourself. For instance if you can see the order being placed into the book before any march is processed you can try to insert yourself into the match engine before anyone else. That’s low latency trading more than HFT though. Likewise price discrepancies between exchanges (microwaves) is low latency.
HFT would typically be something like a market making strategy where you place lots of small orders around where you believe the market is going playing long and shorts. You place bazillions of orders all the time to pick up small variations in a way that on average is better than random trading. This is high frequency trading because the frequency of the trading is high.
Often they get conflated because they complement each other. Being able to do one often implies you can do the other, so why not? They also sometimes help each other synergistically.
Source: I was there (and I’m building my own as a side project with some long time coworkers)
1. Market making 2. Directional trading 3. Arbitrage
The tech is an enabler of these.