GitHub
db83e7505d
fix(security_quotes): 修复 ETF/指数实时行情价格被放大10倍 (Issue #8 )
2026-06-29 22:15:28 +08:00
Justin Gu
3945800728
feat(cli): company-info 传板块名自动读完整正文(分块循环 + 多服务器重试)
...
修复体验问题:此前传板块名仍需用户关心 --offset/--length,太笨拙。
现在传板块名即自动按目录 length 分块循环读取整个板块(单次上限 30720 字节,
大板块如「公司大事」77万字节也能一次读全),--offset/--length 仅传文件名时生效。
- _resolve_filename 返回板块 length,_run_content 分块循环读取完整内容
- 修复分块 offset 推进 bug:原按解码字符串 GBK 重编码计字节,遇 U+FFFD 崩溃;
改为按请求字节数推进(服务器按字节偏移工作)
- 修复多服务器目录版本不一致:传板块名未命中时自动重试多个服务器(最多4次)
- bump 版本号至 1.15.3
2026-06-27 04:37:44 +08:00
Justin Gu
297a479928
chore: 从 git 跟踪移除 CLAUDE.md(本地文件保留)
...
修正上一个 commit:CLAUDE.md 应从版本控制移除(本地配置,不递交 GitHub),
但被误重新加入。本次 git rm --cached 真正移除跟踪,本地文件保留继续使用。
2026-06-27 04:23:46 +08:00
Justin Gu
202415dd19
chore: CLAUDE.md 改为本地文件,不再递交到 GitHub
...
CLAUDE.md 含本地开发指引(venv 使用要求等),属于本地配置。
git rm --cached 移除跟踪(本地文件保留),加入 .gitignore 防止误加回。
2026-06-27 04:22:50 +08:00
Justin Gu
781ee6c48a
feat(cli): company-info 命令合并 + examples/06_finance 文档完善
...
合并 company-info(列目录)与 company-info-content(读正文)为一个命令,
板块名改为可选位置参数:无参数列目录,有参数读正文。消除两个相似命令名
导致的混淆(用户曾误用 company-info SH 601088 "公司概况" 报错)。
- company-info:name_or_filename 可选,无则列 F10 板块目录,有则读正文
- company-info-content:保留为隐藏别名(hidden=True),向后兼容 v1.15.1
- 提取 _run_category/_run_content 模块级函数复用逻辑
- 新增 examples/06_finance/{README.md,company_cli.sh,company_web_api.py}
覆盖 CLI / Python API / Web API 三种调用方式,含 16 个 F10 板块完整列表
- 更新 company_info.py 板块名为实测的 16 板块
- bump 版本号至 1.15.2
2026-06-27 04:22:43 +08:00
Justin Gu
3df1ea607f
chore(release): v1.15.1
...
同步版本号至 1.15.1:pyproject.toml + CHANGELOG。
2026-06-27 04:05:57 +08:00
Justin Gu
29b6ca33aa
feat(cli): 新增 finance-info / company-info / company-info-content 命令
...
把 TdxClient 上已封装但未暴露给 CLI 的三个 F10/财务方法做成命令,
数据源走通达信原生协议(与 Web 层 /finance /company/* 同源),
覆盖 f10(新浪三表)之外的 F10 全文板块。
- finance-info: 最新财务快照(37 字段单期指标),与 f10 多期三表互补
- company-info: F10 板块目录(最新提示/公司概况/财务分析/... 等 16 板块)
- company-info-content: 读 F10 正文,支持板块名(自动解析)或文件名
--offset 语义随入参而定:板块名=板块内相对偏移,文件名=绝对偏移
- conn.py: 新增 get_tdx_client() 上下文管理器
补 README 命令表与 CHANGELOG。
2026-06-27 04:02:09 +08:00
Justin Gu
77104a32e3
fix(ci): mypy python_version 3.10 → 3.12 修复 numpy stub 语法错误
...
根因:CI 的 mypy job 在 Python 3.13 下运行,安装的 numpy 2.x stub
使用 PEP 695 type 语句(3.12+ 语法),但 pyproject.toml 的
python_version="3.10" 让 mypy 按 3.10 语义解析,报
'Type statement is only supported in Python 3.12 and greater'。
修复:
- python_version 提升到 3.12(CI mypy job 实际跑 3.13,开发目标版本对齐)
- mypy/ruff 同步排除 gitignored 的 exchange_margin.py 本地脚本
- 顺带修复 market.py / test_screen.py 的 ruff format 漂移
2026-06-25 03:46:57 +08:00
Justin Gu
e5bc1b1a16
docs: 将 README 中的 Changelog 迁移至独立的 CHANGELOG.md
...
- README 历史版本记录(1.0.0 → 1.14.5)全部搬运到 CHANGELOG.md
- README Changelog 章节替换为指向 CHANGELOG.md 的链接
- CHANGELOG.md 现包含完整 41 个版本(1.15.0 → 1.0.0)的变更记录
2026-06-25 03:41:54 +08:00
Justin Gu
183cbfdd60
chore: ignore local script src/easy_tdx/exchange_margin.py
...
该脚本依赖外部 unified_config / sqlalchemy / requests,不属于 easy_tdx 库,
保持本地运行状态,不纳入版本跟踪。
2026-06-25 03:36:32 +08:00
Justin Gu
f36e2d6a6c
feat(screen): v1.15.0 — 强势股排名 + 修复证券类型识别与名称分批查询
...
新增:强势股排名(screen strength)
- 全市场按 5/20/60 日涨幅加权合成强势分,纯离线扫描
- 三种预设:steady(稳健)/breakout(妖股)/balanced(均衡)
- CLI: easy-tdx screen strength --preset steady --top 50 --table
- Web API: GET /api/v1/market/strength
- 支持自定义权重、成交额过滤、并发扫描
修复:
- _detect_security_type 代码段不全,ETF/基金/科创板/逆回购被误判为 A 股
- screen strength/rank 名称补齐超 80 只时末尾被丢弃(分批查询)
详见 CHANGELOG.md
2026-06-25 03:33:13 +08:00
Justin Gu
85e0f8a65f
feat(chanlun): 分钟级别日期自适应输出时分 YYYY-MM-DD HH:MM
2026-06-17 18:17:32 +08:00
Justin Gu
87f11e409c
release: v1.14.4 — 修复 cmd_chanlun.py ruff format CI 失败
2026-06-16 10:03:48 +08:00
Justin Gu
aa58bd9e88
release: v1.14.3 — 缠论 CLI table 模式补日期(中枢/买卖点/背驰)
2026-06-16 03:04:12 +08:00
Justin Gu
1945fa1261
feat(chanlun): CLI table 模式 zss/mmds/bcs 显示日期字段
2026-06-16 03:00:08 +08:00
Justin Gu
28aad8a84c
release: v1.14.2 — 缠论 JSON 可视化字段增强(中枢/买卖点/背驰补日期)
2026-06-16 02:51:52 +08:00
GitHub and Claude
c54071e85e
release: v1.14.1 — 高级回测 ExecutionModel 路径 3 个真实数据兼容 Bug 修复
...
- datetime 类型分歧(致命):Trade.datetime 转 int 与 PortfolioTracker 的 Timestamp key 失配,TWAP/VWAP/Limit 路径交易全部静默丢失、权益曲线恒定、收益归零
- volume 列名分歧:回测认 volume 而真实行情为 vol,滑点 volume 恒 0 退化百分比模式,VWAP 退化为等权
- date/datetime 列名分歧:日线返回 date 列引擎要 datetime,run() 入口由 date 派生下游无感兼容
新增 3 个回归测试(均红灯验证)。650 单测通过,backtest 模块 ruff + mypy strict 清洁。
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-15 20:50:49 +08:00
Justin Gu
b49cfd66f8
feat(sina): 新增新浪财报三表 — 三层接入(API/CLI/Web),独立数据源
2026-06-15 00:31:13 +08:00
Justin Gu
a5ce783487
release: v1.13.1 — cninfo 公告检索 Bug 修复 + PDF 下载
2026-06-15 00:05:52 +08:00
Justin Gu
574b284dd5
fix(cninfo): URL 404 + type null + 表格截断 + PDF 下载(实测 601088 暴露)
2026-06-14 23:58:24 +08:00
Justin Gu
c0605698f3
docs(cninfo): 补齐 README 三层接入 demo(Python API + Web 返回结构)
2026-06-14 23:35:06 +08:00
Justin Gu
4b439920fc
feat(cninfo): 新增巨潮公告检索 — 三层接入(API/CLI/Web),独立数据源
2026-06-14 23:29:19 +08:00
Justin Gu
a12c2122fc
feat(indicator): 新增 SAR/VWAP/AROON 三指标 + 注册 FK(30 → 34)
2026-06-14 18:46:02 +08:00
Justin Gu
37635af8f2
release: v1.11.6 — CI mypy/ruff 修复
2026-06-13 21:26:13 +08:00
Justin Gu
5fc398255d
fix(types): 修复 CI mypy strict + ruff format 失败
...
mypy (13 errors → 0):
- portfolio/optimizer: register_optimizer 返回类型改为 Callable 装饰器签名
(原标注 type[WeightOptimizer] 导致 4 个子类 Too many arguments)
- factor/engine: _datetime_to_int 用 isinstance 收窄替代 object→int 强转
- factor/analysis: 删多余 type:ignore(改由 mypy override 统一处理 scipy)
- backtest/orders, execution: np.sqrt 表达式用 float() 包裹消除 no-any-return
- MyTT.pyi: MACD 签名删除错误的 LOW/HIGH 参数(与 MyTT.py 实际签名对齐)
- pyproject: 新增 scipy mypy override (ignore_missing_imports)
ruff format: 8 个 test 文件格式化
验证: 564 passed, mypy 192 文件零错误, ruff check/format 全绿
2026-06-13 21:21:33 +08:00
Justin Gu
88638e82ad
release: v1.11.5 — scipy 依赖声明 + 文档同步 + 工程化清理
...
- pyproject: 新增 science 可选依赖组(scipy),dev 纳入 scipy;版本号 1.11.5
- factor/analysis: spearman 分支加 scipy 软依赖保护,缺失时友好报错
- mac/client: 板块排行吞异常处补 logger.debug
- CLAUDE.md: 架构章节补全 mac/ex/unified/portfolio/factor/offline/screen 子包
- .gitignore: 补全 .coverage、signals.json
- README: 补 1.11.5 changelog
2026-06-13 21:10:35 +08:00
Justin Gu
be41746aa9
fix(backtest): _find_bar_index 用 to_numpy().argmax() 取真实位置
...
idxmax() 返回 index label,后续 iloc[] 按位置取行;当 df.index 非默认
RangeIndex 时 label != position,撮合会取错 K 线。两处分支统一改为位置索引。
新增 2 例非连续 index 回归测试。
2026-06-13 21:10:15 +08:00
Justin Gu
095c88f735
fix(transport): ping 容错 TdxConnectionError,避免单台服务器拖垮测速
...
ping_host 仅 except OSError,但握手期 _recv_exact_sock 抛的 TdxConnectionError
继承自 TdxError(Exception) 而非 OSError,逃出捕获后经 ping_all 的 fut.result()
重新抛出,导致非交易时间服务器 accept 后立即 FIN 时整个 easy-tdx ping 崩溃。
- ping_host: except (OSError, TdxConnectionError),对齐 docstring 返回 None
- ping_all: fut.result() 加 try/except 防御层,单 host 失败只跳过不崩
- 新增 2 例回归测试
2026-06-13 21:09:55 +08:00
GitHub and Claude
a6ed0eac16
docs: add quantitative guide, update README + CHANGELOG, bump v1.11.1
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 22:12:19 +08:00
GitHub and Claude
bfefadf70b
feat(backtest): v1.15.0 — attribution analysis
...
- AttributionReport dataclass with Brinson/factor/cost fields
- AttributionAnalyzer with 3 attribution modes:
- Cost attribution (commission/slippage/stamp tax breakdown)
- Brinson attribution (allocation + selection + interaction)
- Factor attribution (factor contribution + specific return)
- Priority: factor > Brinson > cost in full_report()
- 556 tests passing (12 new)
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 21:11:33 +08:00
GitHub and Claude
2eeb7f9806
chore: bump version to v1.15.0
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 21:11:23 +08:00
GitHub and Claude
06f2e1f1a2
feat(backtest): add AttributionAnalyzer with Brinson, factor, cost attribution
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 21:10:50 +08:00
GitHub and Claude
8c2c204002
feat(backtest): v1.14.0 — pluggable slippage models + execution simulation
...
- SlippageModel ABC with 4 built-in models (Fixed, Percent, SquareRoot, Volume)
- ExecutionModel ABC with 4 built-in models (Immediate, TWAP, VWAP, Limit)
- OrderSimulator integration with SlippageModel
- BacktestEngine integration with SlippageModel + ExecutionModel
- Full backward compatibility (all existing code unchanged)
- 544 tests passing (46 new)
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 21:06:15 +08:00
GitHub and Claude
8c4c4a6629
chore: bump version to v1.14.0
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 21:05:46 +08:00
GitHub
0945e47990
feat(backtest): integrate SlippageModel + ExecutionModel into BacktestEngine
2026-06-12 21:04:24 +08:00
GitHub
d18af98855
feat(backtest): add LimitExecution
2026-06-12 20:59:59 +08:00
GitHub
fe68d9da95
feat(backtest): add TWAPExecution + VWAPExecution
2026-06-12 20:56:57 +08:00
GitHub
0772666be3
feat(backtest): add ExecutionModel ABC + ImmediateExecution
2026-06-12 20:53:07 +08:00
GitHub
6414c2cc11
feat(backtest): integrate SlippageModel into OrderSimulator
2026-06-12 20:50:42 +08:00
GitHub
d081eeb265
feat(backtest): add SquareRootSlippage + VolumeSlippage
2026-06-12 20:47:03 +08:00
GitHub
4098af02bf
feat(backtest): add SlippageModel ABC + FixedSlippage + PercentSlippage
2026-06-12 20:44:28 +08:00
GitHub
b7b72b10d1
feat(portfolio): add optimizer, risk model, rebalance engine, CLI pfactor command, bump v1.13.0
2026-06-12 20:25:50 +08:00
GitHub and Claude
e6a69d51e4
feat(portfolio): add optimizer, risk model, and rebalance engine
...
- WeightOptimizer base class with registry (equal, factor_weighted, risk_parity, mean_variance)
- RiskModel with shrinkage covariance estimation and portfolio risk metrics
- RebalanceEngine for multi-period backtesting with commission/slippage
- 20 unit tests covering all components
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 20:22:31 +08:00
GitHub
6b6b7c66a0
docs: add v1.13.0 portfolio management implementation plan
2026-06-12 20:17:43 +08:00
GitHub
303964ea67
feat(factor): add analysis/transform exports, CLI analyze command, bump v1.12.0
2026-06-12 20:11:28 +08:00
GitHub
9d7bf84d5d
feat(factor): add FactorAnalyzer with IC/quantile/turnover/decay analysis
2026-06-12 20:09:08 +08:00
GitHub
c6f2580b73
feat(factor): add factor preprocessing pipeline (winsorize/zscore/rank/fill/orthogonalize)
2026-06-12 20:08:10 +08:00
GitHub
799a4da428
docs: add v1.12.0 factor analysis implementation plan
2026-06-12 20:05:24 +08:00
GitHub and Claude
d5fa572a43
style: ruff format factor module
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 19:58:34 +08:00
GitHub and Claude
d35b08ff85
chore: bump version to v1.11.0
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 19:58:28 +08:00