Inside the black box: the parts of a quantitative trading system
Quantitative funds are often called black boxes: money goes in, trades come out, and the logic in between is hidden. In practice, most quant trading systems are built from the same few modules, each answering a different question. Rishi Narang's book Inside the Black Box, first published by Wiley in 2009 and since revised, popularised a clear way of describing them. This article uses that framework to explain how a systematic trading system is put together.

The overall structure
Narang describes a system in which three models feed a fourth, which hands its output to a fifth:
- an alpha model forecasts returns or price direction;
- a risk model describes the risks the portfolio is exposed to and which ones to limit;
- a transaction cost model estimates what it will cost to change positions;
- a portfolio construction model combines the three to decide target positions;
- an execution model turns the difference between target and current positions into orders in the market.
Data and research infrastructure surround all of them. Separating the parts makes each easier to test and improve, and helps an outsider understand where a strategy's returns and risks come from.
The alpha model
The alpha model is where the strategy's view of the market lives. Narang groups alpha ideas into a handful of families based on what they exploit:
- Trend (momentum): prices that have moved in one direction tend to continue. See our article on momentum strategies.
- Reversion: prices that have moved far from a reference level tend to return to it, as in statistical arbitrage between related stocks.
- Value or yield: cheaper assets, on some measure, tend to outperform expensive ones; carry in currencies is a yield strategy.
- Growth: assets with improving fundamentals tend to outperform.
- Quality: safer, more profitable or better-managed companies tend to outperform on a risk-adjusted basis.
Alpha models can use price data, fundamental data, or alternative data such as text. They can be simple rules or machine-learning models. What matters is that the idea has an economic rationale and survives honest testing, as discussed in our strategy creation guide.
The risk model
The risk model does not try to make money. It identifies exposures that the alpha model is not meant to take and limits them. These can be limits on size (position, sector, gross and net exposure), or limits on exposure to statistical factors such as the market, industries, size, value or momentum. Factor risk models, such as those built on the factors discussed in our article on the Fama-French model, estimate how much of a portfolio's volatility comes from each source. A market-neutral strategy uses the risk model to keep market exposure near zero, so that its returns depend on the alpha rather than on the direction of the market.
The transaction cost model
Every trade costs commissions, the bid-ask spread and market impact, the price movement caused by the trade itself. Market impact grows with trade size relative to available liquidity and is often modelled as proportional to the square root of the trade size relative to daily volume, an empirical regularity reported in several studies. A cost model lets the portfolio construction step decide whether a forecast is strong enough to justify trading. Strategies with weak signals and high turnover are often unprofitable once realistic costs are included.
Portfolio construction
Portfolio construction combines alpha forecasts, risk limits and cost estimates into target positions. There are two broad approaches:
- Rule-based: for example, equal weights in the top-ranked assets, with simple caps.
- Optimisation-based: maximise expected return minus penalties for risk and costs, subject to constraints. This uses all three models at once but is sensitive to errors in their inputs; see our article on portfolio weights.
The execution model
Execution decides how and when to trade: order types, timing, routing between venues, and how to split large orders over time. Execution algorithms aim to trade close to a benchmark such as the volume-weighted average price, or to minimise implementation shortfall, the difference between the price when the decision was made and the actual fill prices. At high frequencies, execution and alpha become hard to separate, as discussed in our article on high-frequency trading.
Questions to ask about any black box
Narang wrote partly for investors evaluating quant managers. Without revealing proprietary details, a manager should be able to answer questions such as:
- What kind of alpha does the strategy rely on, and why should it persist?
- What exposures does the risk model limit, and which ones does it intentionally keep?
- How are costs estimated, and how close do realised costs come to those estimates?
- How was the strategy tested, and how is overfitting controlled?
- What are the main ways it could fail, and how would the manager know?
These questions also make a useful checklist for anyone building a system, from a spreadsheet to a fully automated pipeline.
Where the parts interact
The modules are separate on paper but tightly linked in practice. A strong alpha signal can be worthless if the cost model shows that capturing it requires trading too much. A risk model that neutralises a factor may remove the very exposure the alpha model was exploiting, which is why researchers check a signal's factor loadings before deciding what to hedge. Portfolio construction must handle forecasts that arrive at different speeds, such as a fast reversion signal and a slow value signal, without trading the slow one every time the fast one changes. And the execution model's realised costs feed back into the cost model, which should be recalibrated as the fund grows. A useful exercise for a new system is to trace one trade through all five modules and write down every assumption made along the way.
Sources
- Narang, R. K. (2013). Inside the Black Box: A Simple Guide to Quantitative and High-Frequency Trading, 2nd edition. Wiley. (First edition 2009.)
- Grinold, R. and Kahn, R. (2000). Active Portfolio Management, 2nd edition. McGraw-Hill.
- Almgren, R. and Chriss, N. (2001). Optimal Execution of Portfolio Transactions. Journal of Risk, 3(2), 5–39.
- Perold, A. (1988). The Implementation Shortfall: Paper versus Reality. Journal of Portfolio Management, 14(3), 4–9.
- Tóth, B. et al. (2011). Anomalous Price Impact and the Critical Nature of Liquidity in Financial Markets. Physical Review X, 1, 021006.