china-market-style-factors-akshare
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "china-market-style-factors-akshare" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-a37f12ad70c71c1a3011e958e6a2042551dc1b0f7fedfc672c1fc09b379a5410. Verify the upstream source and version against https://skillhub.cn/skills/user_33655e80/china-market-style-factors before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Build A-share market style and rotation observation reports using only AkShare, covering dimensions such as size, growth/value, small-cap dispersion, dividend/price preference, market trend, and volatility. Produce shadowless charts, interactive HTML, and reproducible data for full history, the last three years, the last year, and the most recent 60 trading days. Intended to judge market preference (large vs. small, growth vs. value) and detect style reversals; uses cross-market index proxies and does not perform per-stock or pure-factor backtests.
Introduction source: third_party · user_33655e80 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: china-market-style-factors-akshare
description: 使用纯 AkShare 构建 A 股市场风格与轮动观察报告,包括规模、成长价值、小市值扩散、红利价格偏好、市场趋势和波动,输出全历史、最近三年、最近一年及最近60个交易日的无阴影图表、交互HTML和可复算数据。用于判断市场偏大盘还是小盘、成长还是价值,以及风格是否反转;采用跨市场指数代理,不是逐股回测纯因子。
slug: china-market-style-factors-akshare
displayName: A股市场风格因子(AkShare)
version: 1.0.0
summary: 纯AkShare生成六项A股市场风格指标、四窗口无阴影图表、交互HTML及可复算数据。
license: MIT
metadata:
version: 1.0.0
language: zh-CNA股市场风格因子(AkShare)
生成日期明确、数据可追溯的市场风格报告。默认使用四个指数相对强弱代理和两个市场环境指标,侧重风格与轮动、历史可靠性和易读性。
运行
以本技能目录为基准定位脚本,不依赖固定工作目录或其他技能。需要 Python 3.10+、网络和本机中文字体。首次运行在任务允许的 Python 环境中安装依赖;不会使用密钥或付费数据源。
python3 -m pip install -r requirements.txt
python3 scripts/run.py --output ./market-style-output
路径包含空格时加引号;已有输出可复用经过完整性核验的缓存。--refresh 强制重新下载。指定历史截止日时运行:
python3 scripts/run.py --output ./historical-output --as-of 2025-08-29
日期自动落到不晚于指定日期的最后一个交易日。默认按上海时间、交易日历及18:00的保守缓冲确定最新完整交易日;这不是对数据供应商完成更新时间的保证,仍必须验证每条序列末日。指定尚未结束的当日交易日或未来日期会报错。节假日允许指定,并回落至此前交易日。
离线复算接受以前由本流程或兼容 AkShare 流程生成的 data/,须含 raw/*.csv、trade_calendar.csv、带 akshare_version 的 fetch_manifest.json。明确指定历史日期;使用新的输出目录:
python3 scripts/run.py --output ./replay-output --as-of 2025-08-29 --offline-data ./market-style-output/data
缺少中文字体时用 --font /path/to/local-cjk-font.ttf 指定已获许可的本机字体;也支持 ttc/otf。不要用不可辨认的方框字交付。技能包不分发字体或历史行情。
必须保持的口径
- 只从 AkShare 接口取数。接口返回成功不等于数据可用:逐条验证最后交易日、缺交易日、重复日期、非正价格、最低历史长度及历史起点。价格数据主接口失败后仅尝试预设备用接口;失败清单写入
data/fetch_manifest.json。不要无限重试,不填平缺失交易日,不悄悄截掉早期历史。 - 四个窗口:各因子完整可用历史、最近3个日历年、最近1个日历年、最近60个交易日收益区间。最后一种需要61个收盘观测。若用户要求自然日,应改实现、图名及核验口径,不能只改标签。
- 每个窗口明确标出真实起止日期。四个风格比值在该窗口首日重设为100;趋势和波动保留百分比单位。环境指标的区间差值用“个百分点”。
- 所有静态、交互、打印图都不绘制历史区间阴影。发布前回溯段只在文字中说明,不能用左侧灰色区间表达“最近”。
- 全历史可以包含指数发布前回溯数据;历史分位排除发布前及预热不足的窗口,只与当日以前的样本比较,至少252个历史样本。
- 价格指数不含现金分红。可用时另做规模与成长价值的全收益敏感性核验;缺失时写明。不得将价格与全收益历史拼接,也不能用红利价格曲线宣称红利投资总回报。
- 核心12条价格序列(含规模稳健性核验)任何一条不完整则停止生成新的报告。可选6条全收益序列不足时,主报告继续,但明确标注核验缺失。脚本非零退出时,不能把输出目录残留的旧报告当成本次成功结果。
具体公式、指数代码、覆盖边界、来源选择和解释阈值见 references/methodology.md。解释指标或改变计算口径前阅读该文件。
核验和交付
运行成功后执行:
python3 scripts/verify_output.py --output ./market-style-output
如需要验证浏览器交互,另安装 Playwright 与 Chromium,然后加 --browser;基本数据与静态图核验不依赖浏览器。
python3 -m pip install 'playwright>=1.50,<2'
python3 -m playwright install chromium
python3 scripts/verify_output.py --output ./market-style-output --browser
交付并打开 market-style-report.html,提供 summary.md 和四张总览图。HTML内嵌绘图库、数据和静态图,生成后可离线打开。需要打包报告时再将本次输出归档;不要将用户数据放进技能发布包。
核心文件:
charts/全历史总览.png、最近三年.png、最近一年.png、最近60交易日.png,以及对应SVG;另有六因子详情图。data/analysis.json、factor_history.csv、current_snapshot.csv、view_snapshots.csv/json:完整曲线、当前读数、24组窗口明细。data/raw/、index_closes.csv、fetch_manifest.json:原始行情、同步收盘价、来源/时间/版本/哈希及失败记录。
文字结论必须依据本次数据重新计算:先报截至哪天,再分别解释60日、20日、10日方向及是否发生反转,并用中证1000/沪深300和可用的全收益对照交叉核验。趋势与波动单独描述。明确这些是指数风格代理,未做行业/Beta中性化,不是可交易多空净值;相对领先不等于资金流入,也不是经过回测验证的交易信号。
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 A 股市场六项风格因子分析,涵盖规模、成长价值、小市值扩散、红利价格偏好、市场趋势和波动,满足投资者判断市场风格轮动的实际需求。
- 输出多窗口无阴影图表、交互式 HTML 和可复算数据,增强用户体验与数据可追溯性。
Highlights
- description 清晰完整,覆盖功能范围、使用场景和技术实现,触发词精准且边界明确。
Highlights
- 文档结构清晰,包含运行说明、口径要求、核验流程,frontmatter 完整,命令示例具体。
Highlights
- 明确数据核验机制,失败处理写入 manifest,核心序列不完整则停止生成,支持离线复算,字体缺失有应对方案。
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 22, 65 -
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 19
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.