3-percent

A tool for A-share/ETF technical SKDJ indicator analysis that identifies oversold golden-cross buy signals and overbought death-cross sell signals, and supports historical backtesting of the strategy.

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 "3-percent" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-08231c4cc8725efae4e88bec4bed5cf87243d5344fba659f6136013dd42d8b8c. Verify the upstream source and version against https://skillhub.cn/skills/user_63c06e28/3-percent 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

A tool for A-share/ETF technical SKDJ indicator analysis that identifies oversold golden-cross buy signals and overbought death-cross sell signals, and supports historical backtesting of the strategy.

0 Downloads

Introduction source: third_party · user_63c06e28 · 1.0.1 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: 3个点技术指标
description: A股/ETF技术面SKDJ指标分析,识别超卖金叉买入与超买死叉卖出信号,支持回测
version: 1.0.1
author: 三条
trigger:
  - 帮我分析XX的技术面
  - 用3个点指标看XX
  - 回测XX的买卖信号
  - SKDJ指标计算
  - XX现在是超买还是超卖
permission:
  - 文件系统读写(生成图表)
  - 网络访问(新浪财经API)
dependency:
  - Python 3.8+
  - numpy pandas matplotlib
pricing: 免费
agent_created: true
disable: false

"3个点" 技术指标

基于通达信 SKDJ 变体的技术分析指标,用于识别超卖区金叉买入和超买区死叉卖出信号。

依赖环境

  • Python 3.8+
  • numpy, pandas, matplotlib
  • 安装命令: pip install numpy pandas matplotlib

核心公式

VAR1 := (2*CLOSE + HIGH + LOW) / 4
VAR2 := LLV(LOW, 34)
VAR3 := HHV(HIGH, 34)
XX    : EMA((VAR1-VAR2)/(VAR3-VAR2)*100, 13)
YY    : EMA(0.667*REF(XX,1) + 0.333*XX, 2)

选股信号: CROSS(XX, YY) AND XX < 20         → 超卖区金叉 → 值30
逃顶信号: FILTER(CROSS(YY, XX) AND XX > 80, 3) → 超买区死叉 → 值60

三大信号点

信号 条件 含义 标记
XX上穿20 CROSS(XX, 20) 且 YY < XX 指标脱离超卖区,关注信号 红色柱
选股信号 CROSS(XX, YY) 且 XX < 20 超卖区金叉,买入参考 '始'
逃顶信号 CROSS(YY, XX) 且 XX > 80 (3日过滤) 超买区死叉,卖出参考 '终'

技能定位

本技能是选股指标体系中的基础指标模块,定位为信号生产者而非决策者:

  • 输入: 证券代码 + 分析周期
  • 产出: 结构化 JSON(信号列表 / 指标统计 / 回测结果 / 最新状态)+ 可视化图表
  • 下游消费者: 其他智能体(如综合选股智能体、策略回测智能体、风险控制智能体)
  • 不做的事: 不直接对最终用户做独立交易建议,不包含仓位管理/止损止盈判断

设计哲学:纯指标计算与数据输出,智能体消费 JSON 后自行推理和组合判断。

数据获取策略

获取K线数据时,按以下优先级依次尝试:

优先级 数据源 调用方式 说明
1 通达信 MCP (tdx_kline) 在调用本脚本前,先通过 tdx_kline 获取K线数据,将返回结果保存为JSON文件,通过 --data-file 传入 数据质量最高,覆盖面广
2 新浪财经免费接口 脚本内置 fetch_data_sina(),自动调用 免费兜底方案,可能存在网络波动
3 统一错误提示 上述两项均失败时,返回: "数据获取失败,请稍后重试" 不静默失败,明确告知用户

使用方法

方式一:直接调用脚本

python3 scripts/three_points.py <代码> [--period 6m|1y|all] [--json] [--no-chart]

示例:

# 使用外部数据文件(来自通达信MCP)
python3 scripts/three_points.py 159206 --data-file /tmp/159206_kline.json --period 6m

# 使用脚本内置新浪财经(兜底)
python3 scripts/three_points.py 159206 --period 6m

python3 scripts/three_points.py 600519 --json          # JSON格式输出
python3 scripts/three_points.py 000001 --period 1y     # 分析1年数据

方式二:在Python中调用

import sys, json
sys.path.insert(0, 'scripts/')
from three_points import analyze

# 直接调用(使用新浪财经兜底)
result = analyze('159206', period='6m')

# 传入外部数据(来自通达信MCP)
with open('/tmp/159206_kline.json') as f:
    tdx_data = json.load(f)
result = analyze('159206', period='6m', external_data=tdx_data)

# result 包含完整的字典格式分析结果,含 _remarks 备注字段

使用指南

当用户请求技术分析时,按以下流程操作:

1. 获取K线数据(按优先级)

优先方案 — 通达信 MCP:

1. 调用 tdx_kline MCP工具:
   - code: "<证券代码>"
   - period: "day"
   - count: 250  (约1年数据,6m周期够用)

2. 将返回的K线数据保存到临时JSON文件:
   - 格式: {"code": "<代码>", "market": "<市场>", "data": [...]}

3. 如果 tdx_kline 成功 → 转到步骤2
   如果 tdx_kline 失败 → 跳过此步,直接进入兜底方案

兜底方案 — 脚本内置新浪财经:

直接运行脚本(不加 --data-file),脚本自动使用新浪财经API获取数据

2. 运行指标计算脚本

# 使用通达信数据(优先)
python3 <skill_dir>/scripts/three_points.py <代码> --period <周期> --data-file /tmp/<代码>_kline.json --json

# 使用新浪财经(兜底)
python3 <skill_dir>/scripts/three_points.py <代码> --period <周期> --json

# 不生成图表
python3 <skill_dir>/scripts/three_points.py <代码> --period <周期> --no-chart --json

支持代码格式:

  • ETF: 159206, 510050, 588000 等
  • 深市: 000001, 002594 等
  • 沪市: 600519, 601318 等

3. 解读返回结果

返回 JSON 中包含:

  • signals.buy_signals — 选股信号列表(金叉+超卖)
  • signals.sell_signals — 逃顶信号列表(死叉+超买)
  • indicator_stats — XX指标统计特征
  • backtest — 回测结果(持有期收益、交易配对)
  • latest — 最新状态(当前XX值、所处区域)
  • chart — 图表文件路径

4. 判断当前状态

根据 latest.status 判断:

  • 超卖区 (XX<20): 价格处于34日低位区域,关注选股信号是否触发
  • 超买区 (XX>80): 价格处于34日高位区域,关注逃顶信号是否触发
  • 中性区 (20≤XX≤80): 正常波动区间

5. 结合上下文给出建议

  • 如果 latest.xx_above_yy == True 且 XX 在上升中:多头占优
  • 如果 latest.xx_above_yy == False 且 XX 在下降中:空头占优
  • 结合回测中的胜率和平均收益评估信号可靠性
  • 重要: 信号在小样本下准确率可能虚高,需结合趋势、成交量等综合判断

6. 附加输出备注

每次输出结束后,必须附加 _remarks 字段的内容。该字段包含指标使用反例与黑名单,是输出的强制组成部分。

⚠️ 如果脚本返回的 JSON 中 error 字段非空,只输出错误信息 + _remarks,不进行后续分析。

回测结果解读

  • hold_results: 买入信号后持有1/3/5/10/20/30日的收益率列表
  • trades: 完整的买入→卖出配对交易记录
  • buy_hold_return: 同期买入持有策略的基准收益
  • 若信号数<3,回测统计意义不足,仅供参考

参数说明

参数 默认值 说明
34 — 价格通道周期,34个交易日≈1.5个月
13 — XX的EMA平滑周期,越大事后性越强
20 — 超卖阈值,XX<20视为超卖
80 — 超买阈值,XX>80视为超买
3 — 逃顶信号过滤周期,避免重复信号

参数偏保守(34/13而非传统的9/3),适合中长线趋势判断。对于短线交易,可调整参数。

输出备注(必须附加)

每次输出结果后,必须附带以下反例与黑名单内容。此内容是输出的强制组成部分,不可省略。

反例清单 — 不要做的事

  1. 不要基于单一"选股信号"直接买入 — 信号仅为技术参考,不构成投资建议
  2. 不要在单边上涨行情中用此指标寻找买点 — 趋势行情中可能长期超买,不触发选股信号
  3. 不要用于短线波段操作 — 34日通道+13日EMA双重平滑,信号滞后于价格转折,适合中长线
  4. 不要在信号少于3次时信任回测胜率 — 小样本下胜率统计意义不足,可能虚高
  5. 不要忽略仓位管理和止损 — 本指标仅提供方向判断,不含仓位/止损/止盈规则
  6. 不要将此指标作为唯一决策依据 — 需结合趋势(如60日均线)、成交量、基本面综合判断

黑名单场景(技能拒绝服务)

场景 原因
用户要求"明天涨不涨"类的短线预测 指标设计为中长线,不可用于T+0短线判断
用户仅凭本指标信号要求直接下单 缺少风险控制、仓位管理和止损止盈逻辑
单边牛市中要求寻找买点 可能长期处于超买区,不会触发选股信号

局限性

  1. 信号频率低: 34日通道+超卖区双重要求,平均2-4个月才一次信号
  2. 滞后性: EMA双重平滑导致信号滞后于价格转折
  3. 不适合单边上涨: 趋势行情中可能长期超买、不触发选股信号
  4. 缺少仓位管理: 仅提供方向判断,不含止损/止盈规则
  5. 样本偏差: 历史回测的胜率可能受特定行情影响

Current listing version

1.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供A股/ETF技术面SKDJ指标分析,解决投资者选股决策中的信号识别痛点
  • 支持回测功能,增强信号可靠性评估
  • 明确区分信号生产者与决策者角色,定位清晰
Trigger Precision85/100

Highlights

  • 触发词覆盖多种用户表达方式,边界清晰
  • 包含回测、指标计算等核心功能触发词
Structure and Standards92/100

Highlights

  • 使用流程完整清晰,包含数据获取、脚本运行、结果解读全流程
  • 提供命令行和Python两种调用方式示例
  • frontmatter完整,参数说明详细
Execution Reliability88/100

Highlights

  • 数据获取有优先级策略和兜底方案
  • 明确处理数据获取失败场景
  • 依赖环境清晰,安装命令明确
Evidence Verifiability (mean of the first four)86/100

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 31

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.