Interleaved — Phase 6

Stock-Market interleaved practice

printable — key stays hidden on paper

Instructions: Solve each problem showing all work. Problems mix quant strategy design, backtesting methodology, and market microstructure — read carefully to identify which concept and method each requires. Round monetary values to 2 decimals and ratios to 3 decimals unless stated. Total: 100 marks.


1. A backtest of a stock universe uses only the 500 companies currently in an index, testing over the prior 10 years. Explain which bias this introduces, its likely direction on reported returns, and one concrete fix. (10 marks)

2. Two stocks A and B have log-price spread st=lnPAβlnPBs_t = \ln P_A - \beta \ln P_B. Over a sample, the spread has mean μ=0.40\mu = 0.40 and standard deviation σ=0.05\sigma = 0.05. Today st=0.53s_t = 0.53. Compute the z-score and state the mean-reversion trade (long/short which leg) assuming β=1\beta = 1. (10 marks)

3. A strategy returns a CAGR of 18%. Starting equity was $50,000 and the test ran 6 years. Compute the ending equity. Then, if the peak equity during the run was $110,000 and the lowest subsequent trough was $82,500, compute the maximum drawdown as a percentage. (12 marks)

4. A momentum rule ranks stocks by their trailing 12-month return skipping the most recent month. A junior quant instead uses the trailing 12-month return including the current partial month's not-yet-closed price. Name the bias this creates and explain why the "skip a month" convention exists. (10 marks)

5. You run a grid search over 4,000 parameter combinations and pick the one with the best in-sample Sharpe of 2.8. Out-of-sample Sharpe is 0.3. Identify the phenomenon, and describe the walk-forward analysis procedure that would have exposed it earlier. (12 marks)

6. An order to buy 2,000 shares hits the limit order book. Available asks: 800 @ $50.00, 700 @ $50.02, 900 @ $50.05. Compute the volume-weighted average fill price and the slippage in cents/share versus the $50.00 top-of-book quote. (12 marks)

7. A pairs strategy trades 40 round-trips per year. Each round-trip incurs $6 commission plus 0.05% slippage on a $20,000 notional per leg (2 legs per round-trip). Gross annual profit is $9,000. Compute net profit after all costs, and the percentage of gross profit consumed by costs. (12 marks)

8. Classify each as look-ahead bias, survivorship bias, or neither: (a) using a stock's closing price to trigger a trade timestamped at market open the same day; (b) computing a moving average that includes tomorrow's price; (c) using point-in-time fundamental data as it was actually reported. Justify each. (10 marks)

9. A quant proposes an ML model with 200 features trained on 3 years of daily bars (~750 rows). State the core caution regarding this feature-to-sample ratio and name two safeguards. (6 marks)

10. Two series are individually non-stationary (random-walk-like) but a linear combination of them is stationary. Name this property, explain why it is the statistical foundation of pairs trading, and state one test used to detect it. (6 marks)

Answer keyMark scheme & solutions

1. (Subtopic 6.2.3 Survivorship bias) Using only current index constituents ignores companies that were delisted, went bankrupt, or were removed — these tend to be the worst performers. Direction: overstates returns (upward bias). Fix: use a point-in-time / delisting-inclusive database that contains the historical constituent list and dead companies. Why this method: problem describes filtering the universe by present membership → survivorship, not look-ahead.

2. (Subtopic 6.1.7 Mean-reversion / 6.1.6 pairs) z=(stμ)/σ=(0.530.40)/0.05=0.13/0.05=2.6z = (s_t - \mu)/\sigma = (0.53 - 0.40)/0.05 = 0.13/0.05 = 2.6. Spread is 2.6σ above mean → spread too high → expect it to fall. Since st=lnPAlnPBs_t=\ln P_A-\ln P_B, a high spread means A rich / B cheap: short A, long B. Why: stationary spread + z-score threshold signals mean reversion, not momentum.

3. (Subtopic 6.2.9 Performance metrics) Ending equity: 50000×(1.18)650000 \times (1.18)^6. (1.18)6=2.69955(1.18)^6 = 2.69955. = 50000 \times 2.69955 = \134{,}977.44.MaxDD. Max DD = (110000 - 82500)/110000 = 27500/110000 = 0.25 = \mathbf{25.0%}$. Why: CAGR is a compounding growth metric; max DD is peak-to-trough — two distinct performance measures.

4. (Subtopic 6.1.8 Momentum / 6.2.4 look-ahead) Including the current unclosed price introduces look-ahead bias (using data not yet finalized/available at decision time). The "skip a month" (12-1) convention exists to avoid the well-documented short-term reversal effect that contaminates raw 12-month momentum; the most recent month tends to mean-revert. Why: tests both momentum construction and data-timing discipline.

5. (Subtopic 6.1.10 Overfitting / 6.1.11 walk-forward) Phenomenon: overfitting / curve fitting — massive parameter search found noise, not signal (IS Sharpe 2.8 → OOS 0.3 collapse). Walk-forward: partition history into rolling windows; optimize parameters on an in-sample window, test on the immediately following out-of-sample window, roll forward, repeat, and stitch OOS results. Consistently poor OOS performance across folds flags the fragility before deployment. Why: IS-vs-OOS gap is the signature of overfitting; walk-forward is the diagnostic tool.

6. (Subtopic 6.3.2 LOB depth / 6.2.6 slippage) Fill: 800@50.00 + 700@50.02 + 500@50.05 (only 500 of 900 needed for 2000 total). Cost =800(50.00)+700(50.02)+500(50.05)=40000+35014+25025=100039= 800(50.00) + 700(50.02) + 500(50.05) = 40000 + 35014 + 25025 = 100039. VWAP = 100039 / 2000 = \50.0195 \approx \mathbf{$50.02}.Slippage. Slippage = 50.0195 - 50.00 = 0.0195 = \mathbf{1.95\ \text{cents/share}}$. Why: walking the book across depth levels quantifies slippage.

7. (Subtopic 6.2.5 transaction cost modeling) Commission: 40 \times 6 = \240.Slippageperroundtrip:2legs×0.05. Slippage per round-trip: 2 legs × 0.05% × \20,000 = 2 × $10 = $20; annual: 40 \times 20 = \800.Totalcost. Total cost = 240 + 800 = $1040.Netprofit. Net profit = 9000 - 1040 = \mathbf{$7960}.Costfraction. Cost fraction = 1040/9000 = 0.1156 = \mathbf{11.6%}$. Why: realistic cost modeling separates paper edge from net edge.

8. (Subtopic 6.2.4 look-ahead vs 6.2.3 survivorship) (a) Look-ahead bias — the close is unknown at the open; you can't trade at open on info from that day's close. (b) Look-ahead bias — tomorrow's price is future data. (c) Neither — point-in-time data as reported is bias-free; this is the correct practice. Why: forces distinguishing timing bias from universe bias.

9. (Subtopic 6.1.9 ML caution / 6.1.10 overfitting) 200 features vs ~750 samples → very high dimensionality; model will overfit noise and appear great in-sample. Safeguards (any two): dimensionality reduction / feature selection, strong regularization (L1/L2), cross-validation or walk-forward OOS testing, ensuring more samples than features. Why: feature/sample imbalance is the classic ML-in-trading trap.

10. (Subtopic 6.1.6 cointegration) Property: cointegration. It is the foundation of pairs trading because although each price wanders (non-stationary), the stationary linear combination (the spread) reliably reverts to its mean, giving a tradable statistical edge. Test: Engle–Granger (ADF on residuals) or Johansen test. Why: cointegration ≠ correlation; it's the specific stat-arb basis.

[
  {"claim":"Ending equity = 50000*(1.18)^6 ≈ 134977.44","code":"e=round(50000*(1.18)**6,2); result = abs(e-134977.44)<0.5"},
  {"claim":"Max drawdown = 25%","code":"dd=(110000-82500)/110000; result = abs(dd-0.25)<1e-9"},
  {"claim":"VWAP fill ≈ 50.0195 and slippage 1.95 cents","code":"cost=800*50.00+700*50.02+500*50.05; vwap=cost/2000; slip=(vwap-50.00)*100; result = abs(vwap-50.0195)<1e-4 and abs(slip-1.95)<1e-2"},
  {"claim":"Net profit 7960 and cost fraction ~11.6%","code":"cost=40*6+40*20; net=9000-cost; frac=cost/9000; result = net==7960 and abs(frac-0.1156)<1e-3"}
]