Level 2 — RecallAlgorithmic & Quant Trading

Algorithmic & Quant Trading

30 minutes50 marksprintable — key stays hidden on paper

Subject: Stock-Market | Chapter: Algorithmic & Quant Trading Level: 2 — Recall (definitions, standard problems, short derivations) Time Limit: 30 minutes Total Marks: 50


Section A — Definitions & Short Answer

Q1. Define algorithmic trading and state two advantages it offers over discretionary manual trading. (4 marks)

Q2. List and briefly describe four essential components of a complete automated trading system. (4 marks)

Q3. Explain the difference between a mean-reversion strategy and a momentum strategy in terms of the assumed price behaviour. (4 marks)

Q4. Define statistical arbitrage and state one key assumption on which it relies. (3 marks)


Section B — Standard Problems

Q5. In pairs trading, two stocks A and B are cointegrated with hedge ratio β=1.5\beta = 1.5. Given prices PA=120P_A = 120 and PB=70P_B = 70: (a) Compute the spread S=PAβPBS = P_A - \beta P_B. (2 marks) (b) If the spread has mean μ=10\mu = 10 and standard deviation σ=4\sigma = 4, compute the z-score. (2 marks) (c) State whether this generates a long or short signal on the spread if the entry threshold is z2|z| \geq 2, and justify. (2 marks)

Q6. A simple mean-reversion rule enters when price deviates 2σ2\sigma below a 20-day moving average. Given a 20-day MA of 250250 and σ=5\sigma = 5: (a) Compute the entry (buy) trigger price. (2 marks) (b) If the exit is set at the moving average, compute the target profit per share. (3 marks)

Q7. A momentum strategy computes the 12-month rate of return. A stock rose from 8080 to 104104 over 12 months. (a) Compute the 12-month return (%). (2 marks) (b) If stocks with return >25%> 25\% are bought, state whether this stock qualifies. (2 marks)


Section C — Concepts & Short Derivations

Q8. Define overfitting (curve fitting) in strategy design and give two warning signs that a backtested strategy is overfit. (5 marks)

Q9. Explain the purpose of walk-forward analysis and describe how in-sample and out-of-sample windows are used. (5 marks)

Q10. State two cautions or pitfalls when applying machine learning to trading, and briefly explain why each is a concern. (4 marks)

Q11. For a cointegration-based pairs trade, explain what it means for two price series to be cointegrated and why cointegration is preferred over simple correlation for pairs selection. (6 marks)


End of Paper

Answer keyMark scheme & solutions

Q1. (4 marks)

  • Definition (2): Algorithmic trading is the use of pre-programmed computer algorithms/rules to automatically generate and execute trade orders based on defined criteria (price, timing, quantity, mathematical models) without continuous human intervention.
  • Advantages (1 each, any two): speed of execution; removal of emotional/behavioural bias; ability to backtest rules; consistent rule application; ability to scan many instruments simultaneously; lower transaction latency.
  • Why: Automation converts a systematic edge into repeatable, disciplined execution.

Q2. (4 marks — 1 each)

  1. Data feed / market data — supplies price and reference data.
  2. Signal/strategy engine — generates buy/sell signals from rules.
  3. Risk & position management — sizing, stops, exposure limits.
  4. Execution/order management (OMS) — routes orders to broker/exchange. (Also acceptable: backtesting engine, monitoring/logging.)

Q3. (4 marks)

  • Mean-reversion (2): Assumes prices oscillate around a fair value; extreme deviations tend to revert. Buys weakness, sells strength.
  • Momentum (2): Assumes trends persist; recent winners continue to rise, losers continue to fall. Buys strength, sells weakness.

Q4. (3 marks)

  • Definition (2): Statistical arbitrage exploits temporary, statistically-identified mispricings among related securities using quantitative models and large numbers of simultaneous positions, expecting mean convergence.
  • Assumption (1): Historical statistical relationships (e.g. mean/spread) persist into the future; relationships are stationary/mean-reverting.

Q5. (6 marks) (a) S=1201.5×70=120105=15S = 120 - 1.5\times70 = 120 - 105 = 15. (2) (b) z=Sμσ=15104=54=1.25z = \dfrac{S-\mu}{\sigma} = \dfrac{15-10}{4} = \dfrac{5}{4} = 1.25. (2) (c) z=1.25<2|z| = 1.25 < 2, so no trade is triggered (2). Why: the spread has not deviated enough beyond its historical mean to signal entry.

Q6. (5 marks) (a) Buy trigger =2502×5=25010=240= 250 - 2\times5 = 250 - 10 = 240. (2) (b) Exit at MA =250=250; profit =250240=10= 250 - 240 = 10 per share. (3) Why: mean-reversion targets convergence back to the average.

Q7. (4 marks) (a) Return =1048080×100=2480×100=30%= \dfrac{104-80}{80}\times100 = \dfrac{24}{80}\times100 = 30\%. (2) (b) 30%>25%30\% > 25\%qualifies / bought. (2)

Q8. (5 marks)

  • Definition (3): Overfitting (curve fitting) is tailoring a model/strategy too closely to historical (noise) data — including excessive parameters — so it fits past data well but fails on unseen data.
  • Warning signs (1 each, any two): too many optimised parameters relative to trades; unrealistically smooth/high backtest equity curve; large gap between in-sample and out-of-sample performance; performance collapses with small parameter changes.

Q9. (5 marks)

  • Purpose (2): Walk-forward analysis tests robustness by repeatedly optimising on a past (in-sample) window and validating on the subsequent unseen (out-of-sample) window, mimicking real deployment.
  • Mechanism (3): Split history into sequential windows; optimise parameters on in-sample block → apply fixed parameters to next out-of-sample block → record results → roll windows forward and repeat. Aggregate out-of-sample results estimate live performance and detect overfitting.

Q10. (4 marks — 2 each)

  • Overfitting to noise: ML models with many features easily fit random patterns in limited financial data → poor live performance.
  • Non-stationarity/regime change: market relationships shift over time, so trained models degrade; also risks include look-ahead bias, data snooping, and lack of interpretability.

Q11. (6 marks)

  • Cointegration (3): Two non-stationary (I(1)) price series are cointegrated if a linear combination PAβPBP_A - \beta P_B is stationary (I(0)) — the spread has a stable mean and reverts.
  • Preferred over correlation (3): Correlation measures short-term co-movement of returns and can be high yet the price gap drifts apart indefinitely; cointegration guarantees a long-run equilibrium spread that mean-reverts, providing a tradeable, stationary signal for entry/exit.
[
  {"claim":"Q5a spread = 15","code":"result = (120 - 1.5*70) == 15"},
  {"claim":"Q5b z-score = 1.25","code":"result = ((15-10)/4) == 1.25"},
  {"claim":"Q6a buy trigger = 240 and profit = 10","code":"trig = 250 - 2*5; profit = 250 - trig; result = (trig==240) and (profit==10)"},
  {"claim":"Q7a 12-month return = 30 percent","code":"result = ((104-80)/80*100) == 30"}
]