How curiouslei/chanlun works
Project type and purpose
• From the README ("缠论实现:K线合并、识别分型、计算笔、计算线段、计算中枢、识别买卖点") and the file tree, we see that this is a Python‐based technical analysis library and CLI tool for ChanLun theory. It ingests market data, processes K-lines, identifies fractals, strokes, segments and central pivots, and emits buy/sell signals. It also provides backtesting via the cobra submodule, hooks into MySQL for storage, and can push alerts via enterprise WeChat.
File structure
• Top-level:
• main.py – CLI entry point.
• chanlun/ – core package.
• Subpackages in chanlun/:
• data/ – adapters to fetch raw market data (jq.py, ts.py), base definitions, transfer logic.
• cobra/ – backtest and parameter‐checking utilities for strategy validation.
• config/ – configuration (e.g., mysql_config.py).
• utils/ – generic helpers (DB connectors, caching, logging, plotting, JSON encoding, WeChat integration).
• Core modules: analyze.py (pipeline orchestration), signals.py (entry to signal logic), objects.py (domain models), enums.py.
• task.py – scheduled or batch task definitions.
Key insights from README
• ChanLun analysis stages and output of buy/sell signals.