XCore HFT / Trading Lab
Statistical arbitrage is a model-risk trade
Quantitative execution, market-microstructure, and risk-control research from XTRSK.
What this problem really is
Statistical‑arbitrage (stat‑arb) strategies are built on the premise that two or more securities have historically moved together, allowing a trader to bet on the re‑convergence of a spread after a temporary divergence. In practice the “historical co‑movement” is an empirical observation, not a guarantee. The moment capital is deployed the market can enter a new regime, the underlying fundamentals can shift, or the pricing engine itself can be altered by a change in liquidity provision. When any of those events occur the spread may drift away indefinitely, turning a seemingly low‑risk bet into a tail‑risk exposure.
The core of the model‑risk problem is that statistical tests—unit‑root, Johansen cointegration, or ADF—are performed on a finite sample that is itself a mixture of regimes. Even a highly significant test result does not protect a trader from a structural break that makes the previous relationship irrelevant. Consequently, the risk of a stat‑arb position cannot be measured solely by the spread’s historical volatility; it must also incorporate the probability that the underlying relationship has ceased to exist.
A further complication is that the profit‑and‑loss (P&L) of a stat‑arb trade is not just the spread movement. Borrowing costs for short legs, funding charges for leveraged long exposure, turnover from frequent re‑balancing, and execution slippage all erode the expected return. If the model does not explicitly price these frictions, the apparent edge may disappear once the trade is live.
Finally, the market’s response to a large, coordinated stat‑arb order can be self‑defeating. By simultaneously buying the long leg and selling the short leg, the trader may push the spread in the opposite direction, extending the half‑life and increasing the likelihood of a loss. The model must therefore contain a mechanism to cap exposure when the observed dynamics diverge from the calibrated parameters.

How the mechanism works, step by step
The first step is to identify a pair (or basket) of instruments whose price series appear to be cointegrated. A vector error‑correction model (VECM) is fitted, producing a spread series and a loading vector that isolates the common factor. The spread is then tested for stationarity; the half‑life is estimated from the mean‑reversion coefficient.
Next, the spread is normalised into a z‑score using an exponentially weighted moving standard deviation. Trading rules are typically defined as “enter long when z < ‑2, exit when z > ‑0.5”, and the opposite for short. At this stage the model also calculates the expected borrowing cost for the short leg, the funding cost for the long leg, and the anticipated turnover based on the expected number of trades per day.
A risk‑control layer is added that monitors two independent signals: a price stop and a time stop. The price stop is triggered when the spread moves beyond a pre‑set multiple of its historical volatility (for example |z| > 4). The time stop forces an exit if the spread has not reverted within a multiple of its half‑life (for example 3 × half‑life). Both stops are evaluated each time the spread is updated.
Finally, the model separates the exposure to the common factor from the residual spread exposure. By hedging the common factor—often through a market‑neutral basket—the trader isolates the pure mean‑reverting component. This reduces the correlation of the strategy’s P&L with broader market moves and limits the impact of regime shifts that affect the common factor but not the residual.
A worked example with real numbers
Consider a pair consisting of Stock A and Stock B. Over the past 250 trading days the log‑price series have a cointegration vector [1, ‑0.87] with a residual spread \(s_t = \ln P_{A,t} – 0.87 \ln P_{B,t}\). An ADF test on \(s_t\) rejects the unit‑root hypothesis at the 1 % level, and the estimated mean‑reversion coefficient is \(\theta = 0.15\) per day, giving a half‑life of \(\ln(2)/\theta \approx 4.6\) days.
The exponentially weighted standard deviation of the spread is 0.025. On day 0 the spread widens to \(s_0 = 0.12\), corresponding to a z‑score of \(z = 0.12/0.025 = 4.8\). The model flags a short‑spread opportunity (z > 2). The intended position size is 1 % of the capital per leg, i.e. \$1 million long Stock A and short \$1.15 million of Stock B (the 0.87 factor translates the notional).
Borrowing the short leg costs 2.5 bps per day, funding the long leg costs 1.8 bps per day, and the expected turnover—based on an average of 1.2 trades per day per leg—adds another 0.5 bps. The total daily carry is therefore 4.8 bps, or roughly \$480 per million of notional.
Because the z‑score is unusually wide, the model widens the position limit by a factor of \(\sqrt{|z|}\) to reflect higher uncertainty, reducing the notional to 0.8 % of capital. The adjusted notional becomes \$800 k long Stock A and \$920 k short Stock B. The expected mean‑reversion profit, using the half‑life estimate, is roughly \(\theta \times s_0 = 0.15 \times 0.12 = 0.018\) per day, i.e. 1.8 % of the spread. After subtracting the 4.8 bps carry, the net expected daily return is about 1.75 % of the spread, which translates to an annualised Sharpe of ~1.3 when volatility of the spread is accounted for.
If after 12 days (≈3 × half‑life) the spread has not moved back within |z| < 2, the time stop forces an exit. Likewise, if the spread widens further to |z| > 6, the price stop triggers an immediate unwind. In the observed data the spread reverted to |z| = 1.2 on day 7, delivering a realised P&L of +\$45 k after costs, well within the model’s risk budget.

Where it breaks in live markets
The first failure mode appears when the statistical relationship is contaminated by a regime shift that the historical window does not capture. For example, a merger announcement, a change in dividend policy, or the introduction of a new market‑making algorithm can alter the price dynamics overnight. In such cases the ADF test still reports stationarity because the sample includes many pre‑shift observations, yet the post‑shift half‑life inflates dramatically, causing the spread to wander for weeks.
A second break occurs when execution costs are underestimated. In a thinly‑traded equity or a high‑frequency futures contract, the market depth may be insufficient to fill the intended size without moving the price. The resulting slippage can be several times larger than the model’s assumed 0.5 bps turnover cost, eroding the edge instantly.
Third, borrowing constraints can appear abruptly. If the short leg is a hard‑to‑borrow stock, the borrow rate can spike from 2.5 bps to 15 bps within a single day, turning a modest carry cost into a substantial loss. The model’s static borrow‑rate assumption therefore becomes a source of hidden risk.
Finally, the feedback effect of the strategy itself can destabilise the spread. When many desks run similar cointegration models, their simultaneous order flow can push the spread away from the equilibrium, extending the half‑life beyond the calibrated value. In extreme cases the spread may exhibit a positive drift, violating the mean‑reversion assumption entirely.
The operating path, stage by stage
The operational workflow begins with data ingestion: high‑frequency tick data are aggregated into 1‑minute bars, and missing quotes are forward‑filled to preserve continuity. A rolling window of 250 minutes is used to re‑estimate the cointegration vector and the VECM parameters each trading day, ensuring that the model adapts to slow‑moving structural changes.
Once the parameters are updated, the spread is computed in real time and normalised to a z‑score using an exponential decay factor of 0.94. The trading engine evaluates the entry thresholds, the price stop, and the time stop simultaneously. If an entry signal is generated, the order manager slices the target notional into child orders that respect the venue‑specific minimum lot size and the pre‑trade risk limits.
During execution the system monitors the realised fill price, the instantaneous market impact, and the remaining queue position. If the fill price deviates from the mid‑quote by more than a pre‑set tolerance (for example 5 bps), the order is cancelled and the spread is re‑evaluated before a new attempt. After each fill, the exposure calculator updates the net market‑neutral hedge on the common factor, adjusting the short‑leg borrow amount and the long‑leg funding requirement.
At the end of each day the performance logger records the realised P&L, the realised carry, and the number of stop events triggered. A nightly batch job aggregates these logs, recomputes the empirical half‑life, and flags any deviation from the expected range. If the observed half‑life exceeds twice the calibrated value, an automatic “regime‑alert” is raised, prompting a manual review of the cointegration pair.

Controls that act before the damage
Pre‑trade controls begin with a sanity check on the raw price series: any series with more than 5 % missing data in the rolling window is rejected outright. The next gate is a factor‑exposure filter that ensures the hedge on the common factor does not exceed 20 % of the total notional, preventing inadvertent market‑directional bets.
A dynamic borrow‑rate monitor watches the market‑wide short‑availability index; if the index rises above a threshold of 0.8, the model automatically scales the short‑leg size down by a factor proportional to the excess. Funding costs are similarly capped: when the overnight repo rate exceeds 3 % the long‑leg exposure is reduced to preserve the target carry budget.
Execution risk is mitigated by a “queue‑value” estimator that projects the expected adverse‑selection cost based on the current order‑book depth and recent fill rates. If the projected cost exceeds 1 % of the intended profit, the order is postponed until the market reverts to a more favourable state.
Finally, a “stop‑layer” runs in parallel with the main engine, constantly checking both the price stop (|z| > 4) and the time stop (elapsed time > 3 × half‑life). The stop‑layer can pre‑empt the entry logic: if a price stop is already breached, the system refuses to open a new position even if the entry threshold is met.

How to measure whether it is working
The primary performance metric is the realised Sharpe ratio after all costs, measured on a rolling 60‑day window. However, Sharpe alone hides the tail risk that is intrinsic to model‑risk trades. Therefore, the strategy also tracks the maximum drawdown relative to the modelled half‑life, the frequency of price‑stop activations, and the proportion of time‑stop exits.
A second diagnostic is the “spread‑reversion efficiency”: the ratio of realised mean‑reversion speed to the calibrated \(\theta\). Persistent under‑performance indicates that the half‑life estimate is biased, perhaps because the regime has shifted.
The third gauge is the carry‑cost variance. By comparing the realised borrowing and funding rates to the modelled averages, the desk can quantify the cost‑model error. A sustained divergence signals that market conditions (e.g., a short‑squeeze) have altered the cost structure.
Finally, the correlation of the strategy’s daily returns with a market‑wide factor (e.g., the S&P 500) is monitored. A rising correlation suggests that the common‑factor hedge is leaking, which could be a precursor to a structural break in the cointegration relationship.
The portfolio view
When the stat‑arb pair sits within a broader portfolio, its risk contribution must be assessed in aggregate. The residual spread exposure is typically low‑beta, but the common‑factor hedge may overlap with other market‑neutral or macro‑neutral positions, creating hidden concentration. A covariance matrix that includes the residuals of all stat‑arb pairs, together with the factor‑hedge exposures, allows the desk to compute the portfolio‑level value‑at‑risk (VaR) and expected shortfall (ES).
Liquidity metrics are also portfolio‑wide. If several pairs share the same short leg, the aggregate borrow demand can push the short‑rate up, increasing the cost for all affected positions. The desk therefore imposes a global borrow‑rate budget that caps the total short‑leg notional at a level that keeps the weighted average borrow cost within a pre‑agreed range.
Turnover is another cross‑pair consideration. Because each pair has its own half‑life, the combined turnover can become substantial, especially when many spreads are near their entry thresholds simultaneously. By staggering the entry windows or applying a portfolio‑level turnover ceiling, the desk avoids excessive transaction costs that would otherwise erode the collective edge.
In practice, the portfolio manager reviews a daily dashboard that summarises: (i) the number of active spreads, (ii) the average realised half‑life, (iii) the aggregate borrow and funding costs, (iv) the total VaR contribution, and (v) any stop‑layer alerts. Adjustments are made either by scaling down specific pairs, rotating to a new cointegration set, or tightening the stop thresholds until the portfolio’s risk‑adjusted return aligns with the desk’s target.
Do you have a systematic process in place to detect when a historically‑stable spread has entered a new regime before capital is at risk?
About the research behind this lesson
The seminar frames electronic markets as price-time-priority queues. It separates queue value into spread capture versus adverse-selection cost and the option value of retaining a place in line.
Applied to this lesson: An order lifetime therefore cannot be based on elapsed time alone: the system must reassess whether its queue position, expected spread and adverse-selection risk still justify keeping the order alive.
Two live systems, one desk
PULSE-X — power-packed HFT: high-frequency momentum on XAUUSD and EURUSD. System details · Live account
NIC-X — ultra-low drawdown: displaced-print arbitrage for large capital. System details · Live account
Start now: leave your email and request a free trial — we will send the pricing, the connection route and the trial terms. Pricing
Join the market discussion: Telegram @squawklive
Source: High-Frequency Trading and Modern Market Microstructure
Educational content only. Trading leveraged products involves risk.
Chat with XTRSK
Chat ready
Start a chat and the XTRSK team will be notified immediately.