Six systematic macro alpha signals: C++26 hot-path engines + Python 3.13 research interface β production-grade for Cubist/Citadel/Millennium quant pods.
- π 0 Strategy Deep Dives
- π 1 Repository Structure
- π 2 Solution Overview
- β¨ 3 Technology Features
- π 4 Mathematical Concepts
- ποΈ PDRRM Signal (Policy Divergence Γ Real Rate Momentum)
- π’ TPMCR Signal (Term Premium Momentum & Curve Regime Signal
- π MAERM Signal (Macro-Adjusted Earnings Revision)
- π ISRC Signal (Inventory Surprise Γ Roll Return Composite)
- βοΈ VSRA Signal (Volatility Surface Regime Arbitrage)
- π₯ FDSP Signal (Fiscal Dominance Shock Propagation)
- β±οΈ Signal Decay Monitor
- π‘οΈ Vol-Targeted Positions
- ποΈ Architecture
- π Quick Start: Build & Run
- βοΈ 5 Prerequisites & Installation
- π 6 Notebook: research.ipynb
- ποΈ 7 Compile, Build & Run
- πΊοΈ 8. Improvement Roadmap
systematic_macro_2026_alpha_research/
βββ .bazelrc # C++26 -O3 -march=native -mavx2 flags
βββ .gitignore
βββ .github/workflows/ci.yml # Bazel gateway: build, test, daily decay monitor + Slack
βββ BUILD.bazel # Root targets: backtest monitor research docker_*
βββ WORKSPACE # Deps: Eigen3, GoogleTest, nanobind, rules_python
βββ CMakeLists.txt # Installs alpha_cpp.so into Python site-packages
βββ Dockerfile # Multi-stage: cpp-builder β python:3.13-slim
βββ docker-compose.yml # Services: jupyter, backtest, monitor
βββ pyproject.toml # Hatchling: alpha_research pkg + all Python deps
βββ run.sh / run.bat # Ubuntu/Win11 launchers (Bazel gateway)
βββ cmake/alpha_research-config.cmake.in
βββ data/ # Market data CSVs (or synthetic)
βββ notebooks/research.ipynb # 28-cell production research notebook
βββ scripts/runner.py # Bazel dispatcher (backtest/monitor/jupyter/docker)
βββ src/
β βββ cpp/ # C++26 engines
β β βββ math_utils.hpp # EWMA, RingBuffer(lock-free), ridge, Sharpe, IC, HL
β β βββ pdrrm_engine.hpp # PDRRM: RRDM+PSS+RAC, ridge weights, vol-targeted pos
β β βββ strategies_engine.hpp# TPMCR, MAERM, ISRC, VSRA, FDSP online tick() engines
β β βββ portfolio_optimizer.hpp # BacktestEngine, KPIBundle, SignalDecayMonitor
β β βββ bindings.cpp # nanobind PythonβC++26 bridge (zero-copy ndarray)
β β βββ signal_demo.cpp # Standalone CLI demo binary
β βββ python/alpha_research/ # Python 3.13 package (importable as alpha_research)
β βββ data.py # Polars ingestion + 10-yr synthetic generator
β βββ signals.py # Signal orchestration β C++26 engines
β βββ backtest.py # BacktestOrchestrator + black-swan stress tests
βββ tests/
β βββ cpp/test_engines.cpp # Google Test: 40+ tests, 100% engine coverage
β βββ python/test_pipeline.py # pytest: 50+ tests, 100% module coverage
βββ third_party/ # Bazel BUILD files for Eigen3 + nanobind
| Strategy | Full Name | Engine | Asset Class | Horizon | 2026 Edge |
|---|---|---|---|---|---|
| PDRRM | Policy Divergence Γ Real Rate Momentum | PDRRMEngine |
G10 FX Futures | 2β8 wks | BOJ hiking sole G10 tightener β trending JPY real rate gap |
| TPMCR | Term Premium Momentum & Curve Regime Signal | TPMCREngine |
Rates Futures | 3β8 wks | ACM term premium momentum; 3-wk duration manager rebalancing lag |
| MAERM | Macro-Adjusted Earnings Revision Momentum | MAERMEngine |
Equity Futures | 2β6 wks | ISMΓEPS revision interaction; AI hyperscaler upside |
| ISRC | Inventory Surprise Γ Roll Return Composite | ISRCEngine |
Energy Futures | 1β4 wks | EIA inventory surprise Γ roll return (3Γ amplifier in backwardation) |
| VSRA | Volatility Surface Regime Arbitrage | VSRAEngine |
SPX Options/VIX | 1β3 wks | VRP + VIX term-structure carry + tariff-panic skew overshoot |
| FDSP | Fiscal Dominance Shock Propagation | FDSPEngine |
Cross-Asset | 2β8 wks | Debt-ceiling propagation kernels: VIXβGoldβTLT V-shape |
All six signals are combined via PCA risk-budgeting in a master QP with TC penalty.
dataclasses(slots=True, frozen=True)β cache-line-efficient config structstyping.NamedTupleresult bundles;match/casedispatcher- Polars (no pandas) β Arrow/SIMD backend, LazyFrame query plans,
.to_numpy()zero-copy β C++ __future__.annotationsPEP 563 for forward refs
std::expected<T,E>β monadic error handling, no exceptions on hot pathstd::print/std::println(P2093R14)- Designated initialisers for self-documenting
DayData{.tp_acm_10y=1.2, β¦} [[nodiscard]],[[likely]],[[unlikely]],std::assumefor vectoriser hintsalignas(64)RingBuffer<N>with power-of-2 branchless modular indexing- Eigen column-major matrices;
-mavx2 -mfmavia.bazelrcfor SIMD BLAS
ndarray<double, ndim<2>, c_contig>βEigen::Mapzero-copy bridgenb::capsulecustom deleter for safe numpy buffer ownership- Full type-safe exposure of all six engines +
KPIBundle+BacktestEngine
flowchart TD
D["Polars DataFrames"] --> PY["Python 3.13 Orchestrator"]
PY -->|nanobind zero-copy| CPP["C++26 Engines AVX2/SIMD"]
CPP --> P["PDRRM"] & T["TPMCR"] & M["MAERM"] & I["ISRC"] & V["VSRA"] & F["FDSP"]
P & T & M & I & V & F --> BT["BacktestEngine KPIBundle"]
BT --> MON["SignalDecayMonitor"]
MON -->|HL lt 30d| SLK["Slack Alert"]
BT --> NB["research.ipynb"]
sudo apt-get install -y build-essential cmake ninja-build \
python3.13 python3.13-dev libeigen3-dev git curl
# Bazelisk
curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \
-o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel
# Python package (editable, no absolute paths)
pip install -e ".[dev]"
# C++ extension
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -G Ninja
cmake --build build --parallel && cmake --install build
python -c "import alpha_research; import alpha_cpp; print('All OK')"winget install Kitware.CMake Microsoft.VisualStudio.2022.BuildTools
pip install -e .[dev]
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
cmake --install build28-cell production notebook covering:
| Β§ | Content |
|---|---|
| 1 | Synthetic 2520-day market data; Polars DataFrame inspection |
| 2 | PDRRM RRDM/PSS/RAC heatmaps; ridge weights via C++26 |
| 3 | All 6 strategy signal panels |
| 4 | KPI radar chart (Sharpe/Sortino/Calmar/IC) |
| 5 | Cumulative PnL + drawdown (Plotly dual-axis) |
| 6 | 60-day rolling IC with Β±2Ο bands |
| 7 | Black-swan stress test table (COVID/2022/2024) |
| 8 | Signal decay monitor with half-life threshold |
| 9 | ACM term premium + VIX term structure + skew surface |
| 10 | PCA cross-signal correlation + PC variance attribution |
| 11 | Full Polars KPI summary table |
Run (Ubuntu local): ./run.sh notebook β http://localhost:8888
Run (Docker): ./run.sh docker-notebook β http://localhost:8888
Run (Windows local): run.bat notebook
Run (Windows Docker): run.bat docker-notebook
# Ubuntu β all via Bazel (common gateway)
./run.sh build # bazel build //...
./run.sh test # bazel test //:test_all
./run.sh backtest # bazel run //:backtest
./run.sh monitor # bazel run //:monitor
# Windows
run.bat build
run.bat test
run.bat backtest
# Docker
./run.sh docker-build
./run.sh docker-notebook # http://localhost:8888
./run.sh docker-down
# CMake alternative
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -G Ninja
cmake --build build --parallel
ctest --test-dir build --output-on-failure
pytest tests/python/ -vTrigger by pushing to main or develop. Force-trigger:
gh workflow run ci.ymlRequired secret: SLACK_WEBHOOK (Settings β Secrets β Actions).
Jobs: cpp-build-test Β· python-lint-test (every push) Β· signal-monitor (daily 06:00 UTC) Β· full-backtest (push to main).
- TPMCR: Replace rule-based regime with full Baum-Welch HMM (hmmlearn in deps, ready to swap)
- PDRRM: Add BOJ JGB purchase tapering as 4th signal component
- FDSP: Re-calibrate propagation kernels with 2026 debt-ceiling episode data
- Monitoring: Upgrade from daily to 4-hour IC cadence; add BOCPD changepoint detection
- Risk: Add cross-signal TC optimisation (shared QP minimises total portfolio turnover, not per-strategy)
- Replace nanobind with native CPython 3.14 limited API for sub-100Β΅s bridge latency
- Migrate covariance estimation to GPU (CUDA 13 + cuSOLVER) for 200+ instrument universes
- Alternative data: Satellite shipping data Γ ISRC; LLM-parsed FOMC transcript sentiment Γ PDRRM PSS
- Meta-model: HMM + gradient-boosted regime classifier to dynamically reweight 6 strategies
- Cross-signal alpha: Research PDRRM Γ TPMCR multiplicative interaction (JPY rally amplified when US term premium also rising)
- Variance swap replication for cleaner VRP capture in VSRA; gamma overlay for FDSP during stress