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
GitHub and Claude
54e06009d4
test(factor): add integration tests for FactorEngine with builtins
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 19:57:18 +08:00
GitHub
f47a6df776
feat(cli): add 'easy-tdx factor list' command
2026-06-12 19:55:40 +08:00
GitHub
d9bb37f750
feat(factor): wire up builtin factor auto-registration and export
2026-06-12 19:53:18 +08:00
GitHub and Claude
c9be1f85d9
feat(factor): add 19 builtin factors (momentum/volatility/quality/volume/technical/chanlun/value)
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 19:50:05 +08:00
GitHub and Claude
e766cace73
feat(factor): add FactorEngine with single/cross-section/forward-return compute
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 19:47:08 +08:00
GitHub
67d9963f20
feat(factor): add Factor base class and registry
2026-06-12 19:43:54 +08:00
GitHub
7d6607b0cf
docs: add v1.11.0 factor engine implementation plan (13 tasks, TDD)
2026-06-12 19:35:16 +08:00
GitHub
64f8a5e8b6
docs: add quantitative factor engine + portfolio management design spec
2026-06-12 19:27:02 +08:00
GitHub
e6ed6efcd4
chore: bump version to v1.10.5 + update changelog
2026-06-12 17:19:47 +08:00
GitHub and Claude
de2b37e1e3
fix(web): use redoc@2.2.0 standalone bundle (v3 is ESM-only)
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 17:06:54 +08:00
GitHub and Claude
79c81cc3b6
fix(web): override redoc endpoint with pinned JS v3.0.0-rc.0
...
FastAPI does not accept redoc_js_url as a constructor param — the old
approach silently ignored it, leaving the default redoc@next CDN URL
(which returns 404). Manually register /redoc with get_redoc_html()
using the fixed v3.0.0-rc.0 bundle URL.
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 17:05:25 +08:00
GitHub and Claude
9848d754a8
fix(web): use redoc@3.0.0-rc.0 bundle
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 16:55:21 +08:00
GitHub and Claude
0d673f1972
fix(web): pin ReDoc JS to v2.1.3 (cdn redoc@next returns 404)
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 16:54:03 +08:00
GitHub and Claude
46c5d3cc05
fix(web): guard MAC client None + filter _raw bytes from Ex responses
...
- get_mac_client() now raises TdxConnectionError (503) when MAC client
is None, matching get_ex_client() behavior. Previously returned None
causing AttributeError (500) on all 12 MAC endpoints.
- _records_to_df_resp() filters out internal _raw: bytes fields from
Ex dataclass models. Previously asdict() included binary protocol
data that is not JSON-serializable and would cause 500 errors.
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 16:51:47 +08:00
GitHub and Claude
d17895e92b
feat(web): full Web API parity with CLI — 18 new endpoints (v1.10.2)
...
- Board analysis: list/members/belong/summary/ranking/change-ranking (6)
- Capital flow, symbol info, server info (3)
- Quote list, auction, unusual (3)
- Extended market: bars/quote/minute/transaction (4)
- Technical indicators: list + compute (2)
- Multi-client DI: AsyncMacClient + AsyncExTdxClient lifecycle
- 6 MAC enum converters, DictResponse, ComputeIndicatorsRequest schemas
- Web API endpoints: 22 → 40
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-12 16:46:48 +08:00
Justin Gu
06ce712d15
fix: CI mypy job missing [web] deps + update README intro
2026-06-12 03:52:47 +08:00
Justin Gu
2eedd81093
feat(web): FastAPI REST + WebSocket API layer (v1.10.0)
2026-06-12 03:36:11 +08:00
Justin Gu
d904ae7af6
docs(web): update README with serve CLI, docs URL, and install instructions
2026-06-12 03:35:26 +08:00
Justin Gu
0e74752701
fix(web): validate market/category input — support lowercase, reject invalid with 400
...
Root cause: _market_from_str/_market/_category in routers used bare
MarketEnum[key]/Market[key] without .upper() or try/except, so
lowercase or invalid values (sz, ZZZ) threw uncaught KeyError → 500.
Fix: extract shared convert.py with market_from_str/category_from_str
that do .upper() + ValueError on invalid input. All 4 routers updated.
4 regression tests added for case-insensitive and invalid input.
2026-06-12 03:26:29 +08:00
Justin Gu
9d7a9161f7
fix(web): remove TYPE_CHECKING guard for AsyncTdxClient in deps.py
...
The typing.cast(AsyncTdxClient, ...) evaluated AsyncTdxClient at
runtime, but the import was gated behind TYPE_CHECKING, causing
NameError in production. Direct import is safe here — web module
already depends on easy_tdx core.
2026-06-12 03:21:39 +08:00