FWIW, I just took a look at our HFT trading system. We specialize in colocated low latency market making in an equity market in a mid-sized country. The following line counts are only for the C++ code directly used in the production system. Doesn't count research, model fitting, ETL pipelines, build systems, etc.
75 kloc - Total line count
10 kloc - Common libraries, utilities, data structures, etc.
10 kloc - Reconstitutes the limit order book from the data feed
10 kloc - General framework (order management, margin tracking, logging, runtime control hooks, etc.)
13k - Adapter for the exchange's datafeed protocol
5k - Adapter for the exchange's order gateway protocol
3k - System for correlating our orders within the datafeed
10k - Signals/alphas
8k - Trading logic
Not claiming that other people's systems will necessarily look anything like ours, but my experience jibes with this too. Trading code is only about 10% of the total codebase for a production-ready trading system. Overall strategy-specific code (signals and trading logic) only make up 25% of the codebase, with the rest being all general-purpose "plumbing".
Even a tiny inconsequential function that most people never think about- reliably identifying which orders in the data feed belong to us- takes nearly half the amount of code as nearly all the trading logic put together.
75 kloc - Total line count
10 kloc - Common libraries, utilities, data structures, etc.
10 kloc - Reconstitutes the limit order book from the data feed
10 kloc - General framework (order management, margin tracking, logging, runtime control hooks, etc.)
7 kloc - Safety checks (pre/post trade, price, circuit breakers, etc.)
13k - Adapter for the exchange's datafeed protocol
5k - Adapter for the exchange's order gateway protocol
3k - System for correlating our orders within the datafeed
10k - Signals/alphas
8k - Trading logic
Not claiming that other people's systems will necessarily look anything like ours, but my experience jibes with this too. Trading code is only about 10% of the total codebase for a production-ready trading system. Overall strategy-specific code (signals and trading logic) only make up 25% of the codebase, with the rest being all general-purpose "plumbing".
Even a tiny inconsequential function that most people never think about- reliably identifying which orders in the data feed belong to us- takes nearly half the amount of code as nearly all the trading logic put together.