Replications of Ernest P. Chan (2013), Algorithmic Trading: Winning Strategies and Their Rationale. Wiley, using Python with pyatl.
- Time series analytics (chapter 2)
- Augmented Dickey-Fuller Test
- Hurst Exponent and Variance Ratio Test
- Half-life of Mean Reversion (
johansen-linear,calendar) - Cointegration and Johansen Test for Cointegration (
johansen-linear: the eigenvector and the lookback are estimated on the whole file, so its figure looks ahead)
- Mean Reversion Strategies (chapter 3)
- Linear mean-reverting (
linear,linear-log,ratio) - Bollinger Bands (
bollinger) - Kalman Filter (
kalman)
- Linear mean-reverting (
- Mean Reversion of Stocks and ETFs (chapter 4)
- Buy-on-Gap Model (
bog) - Cross-Sectional Linear Long-Short (
linear-longshort/longshort) - Arbitrage between an ETF and Component Stocks (
indexarb)
- Buy-on-Gap Model (
- Mean Reversion of Currencies and Futures (chapter 5)
- Futures and currencies are replicated as stocks; the rollover interest is added outside the replay.
- Trading Currency Cross-Rates (
johansen-rolling) - Rollover Interests in Currency Trading (
rollover) - Trading Futures Calendar Spread (
calendar: MATLAB rule on the CSV to 2012-05-02; half-life and expiries from the whole sample) - Volatility futures versus Equity index futures
- Interday Momentum Strategies (chapter 6)
- Time series momentum (
tsmom) - Cross-sectional momentum (
xsmom)
- Time series momentum (
- Intraday Momentum Strategies (chapter 7)
- Opening Gap Strategy (
gap) - Post-Earnings Announcement Drift (
pead)
- Opening Gap Strategy (
It needs Python 3.12 or newer, uv, and an installed algotradelib; see its install guide.
uv sync builds pyatl from source against that library, so it also needs a C++17 compiler and CMake.
uv syncIf algotradelib is installed under a prefix CMake does not search, set CMAKE_PREFIX_PATH to that prefix for uv sync.
uv run atl-strategy -s <strategy_name> -d <data_path> ...This project was developed with the assistance of generative AI tools.
This project is released under the MIT license; see LICENSE. The software is provided as is, without warranty of any kind, and the authors are not liable for any loss, including trading losses, arising from its use. Nothing in this repository is investment advice.