Skip to content

v1.0.0 — ETF Pattern Matching Acceleration · 形态匹配 ETF 策略加速

Latest

Choose a tag to compare

@redamancy231-create redamancy231-create released this 16 Jul 05:28
· 44 commits to master since this release

What is this?

Python+C++ hybrid programming practice: extracted pure-computation modules from a Chinese ETF pattern-matching strategy and accelerated with pybind11 + C++20. Not a trading system — no live trading code, no backtest claims.

Performance

Function Python C++ Speedup
DTW Distance (L=19) 98 µs 2.7 µs 37×
Pattern Match (single) 14.3 ms 0.23 ms 61×
Batch Match (100 calls) 50 ms 23 ms 2.2×

What is included

  • 6 pure-computation Python modules (src/core/) — DTW, pattern matching, technical indicators, market features, risk controls, metrics
  • 8-function C++ acceleration module (src/cpp/etf_core.cpp, ~1,100 lines) — pybind11 bindings with full GIL management
  • 54 unit tests + 2 verification scripts — C++ vs Python parity verified
  • Interactive Jupyter demo (31 cells) — walk through the full algorithm
  • Performance analysis article (docs/performance-analysis.md, bilingual) — why 61× single-call → 2.2× batch
  • Bilingual README (Chinese + English)

Review Chain

Round Backend Role Findings
R1 Kimi-K2.7 Adversarial review Code improvements (GIL, batch contract)
R2 GPT-5.5 Completeness review Cross-file consistency
R3 GPT-5.5 Final review Edge case coverage
R4 Kimi-K2.7 Code improvement Boundary tests + batch convergence
— GPT-5.6-Sol Full code audit (2026-07-12) 32 findings (9 P0), all fixed
— Kimi-K2.7 Regression audit (2026-07-12) 0 regressions

Build

cmake -B build -DPython_EXECUTABLE="<path-to-python.exe>"
cmake --build build --config Release
python verify_etf_core.py

Requirements: Python 3.12+, NumPy, pybind11 3.0.4, CMake 3.20+, MSVC 19.51 (or Clang 16+)


This project is a programming practice — not investment advice, not a trading system.
🤖 Generated with Claude Code