Markets: A Rigorous Course

Part II · Trading equities · M04 · week 2 · 14 h

Systematic trading research and swing trading

Technical analysis restated as testable hypotheses; swing frameworks (Weinstein, Minervini, O'Neil, Darvas) as rule sets; momentum and reversal evidence; backtesting without bias; the statistics of the Sharpe ratio; multiple testing and the deflated Sharpe ratio.

Builds on M01 Market structureM02 Statistics of returnsM03 Kelly and ruin

Prerequisites M01 (cost algebra, order types), M02 (returns, autocorrelation, heavy tails), M03 (expectancy, R-multiples, Kelly). Mathematics: asymptotic normality and the delta method, order statistics, conditional expectation, basic hypothesis testing. Time: ~14 hours (week 2 Thu–Sun: 4.1–4.4; week 3: 4.5–4.7, problems, code). Primary texts: López de Prado, Advances in Financial Machine Learning (Wiley, 2018), Ch. 7 and 11–14; Chan, Algorithmic Trading (Wiley, 2013), Ch. 1 and 6; Lo (2002) "The Statistics of Sharpe Ratios"; Harvey, Liu and Zhu (2016); Bailey and López de Prado (2014) "The Deflated Sharpe Ratio". For swing methods: Weinstein (1988), O'Neil (4th ed., 2009), Minervini (2013).

Learning outcomes

  1. Write any common technical indicator (moving average, breakout, RSI, relative volume, relative strength) as an explicit function of the price history, and state the trading rule built on it as a falsifiable hypothesis about conditional expected returns.
  2. Prove that a moving-average crossover on log prices is a positively weighted sum of past returns, and derive the expected return of a linear trend rule in terms of drift and autocovariances.
  3. Translate Weinstein, Minervini, O'Neil and Darvas into codable rule sets, list the parts that cannot be coded without point-in-time data, and compute the breakeven win rate of a swing system after Indian costs.
  4. Derive the Lo–MacKinlay decomposition of momentum profits and explain, with a beta argument, why momentum crashes after bear markets.
  5. Build an event-driven backtester with costs that provably has no look-ahead, and prove when a vectorised backtest gives the same answer.
  6. Derive the asymptotic standard error of the Sharpe ratio, the probabilistic Sharpe ratio and the minimum track-record length, and compute them for a strategy.
  7. Derive the expected maximum Sharpe ratio of N skill-less strategies from extreme-value theory, and compute the deflated Sharpe ratio.
  8. Prove that Bonferroni and Holm control the family-wise error rate and that Benjamini–Hochberg controls the false discovery rate, and explain White's Reality Check and the probability of backtest overfitting.

Sections ≈ 2 h 35 min of study

  • Foundation 3 sections · ≈ 40 min
  • Core 8 sections · ≈ 1 h 55 min
  1. Learning outcomes Foundation 5′
  2. 4.1 Technical analysis as statistical hypotheses Core 20′
  3. Figure Moving-average rules are momentum rules
  4. 4.2 Swing-trading frameworks as testable rule sets Foundation 25′
  5. 4.3 Evidence: momentum, reversal and crashes Core 20′
  6. 4.4 Backtesting methodology Core 20′
  7. Figure Walk-forward analysis with purging
  8. 4.5 Statistics of the Sharpe ratio Core 10′
  9. Figure How uncertain is a Sharpe ratio?
  10. 4.6 Selection bias and multiple testing Core 25′
  11. Figure The best of many backtests
  12. Lab A Nifty trend rule, with costs
  13. 4.7 Case studies Core 10′
  14. Summary of key results Foundation 10′
  15. Readings and resources Core 5′
  16. Facts that change Core 5′

Create a free account

Reading is open to everyone. An account keeps your progress, answers, notes and code drafts, and gives you the study plan, the journals and the simulator. Running code needs an account approved for it.