Xpersona
技

技术分析-缠论

CLAWHUB · Unverified

基于缠中说禅理论自动识别A股技术面要素,生成带分型、笔、线段、中枢、背驰的技术分析图表和报告。 Skill: 技术分析-缠论 Owner: laigen Summary: 基于缠中说禅理论自动识别A股技术面要素,生成带分型、笔、线段、中枢、背驰的技术分析图表和报告。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-03-27T07:13:13.068Z | auto ChanLun Technical Analysis Skill v1.0.0 - Initial release supporting ChanLun (缠论) technical analysis for A-share (A股) stocks. - Automates key ChanLun concepts: fractal (分型) recognition, stroke (笔), line segment (线段), pivot (中枢), and divergence (背驰) detectio

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s174c3qf7rzby58ss8ght6wmyd83hx75:chanlun-technical-analysis
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-laigen-chanlun-technical-analysis/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

10,432 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

# ChanLun Technical Analysis Skill

基于缠中说禅技术理论,实现 A 股股票的技术面分析,包括分型、笔、线段、中枢、背驰等核心概念的自动识别与可视化。

## 核心功能

| 功能 | 说明 |
|------|------|
| **分型识别** | 顶分型(Top Fractal)、底分型(Bottom Fractal)自动检测 |
| **笔识别** | 顶底交替连接,K 线包含处理 |
| **线段识别** | 至少 3 笔,有重叠区域 |
| **中枢识别** | 至少 3 笔重叠区域 |
| **背驰检测** | MACD 柱面积比较 |
| **图表绘制** | K 线 + 分型 + 笔 + 线段 + 中枢 + MACD + 成交量 |
| **报告生成** | Markdown 格式技术分析报告 |
| **PNG 图片** | 直观的技术图形展示(主图 + 副图),英文标签 |

---

## 缠论核心概念

### 1. 分型 (Fractal)

**顶分型**: 第二 K 线高点是相邻三 K 线高点中最高的,低点也是相邻三 K 线低点中最高的
- 顶分型的最高点叫该分型的顶

**底分型**: 第二 K 线低点是相邻三 K 线低点中最低的,高点也是相邻三 K 线高点中最低的
- 底分型的最低点叫该分型的底

### 2. K 线包含处理

**向上处理**: 两 K 线高点取高者,低点取较高者
**向下处理**: 两 K 线低点取低者,高点取较低者

### 3. 笔 (Stroke)

- 两个相邻的顶和底构成一笔
- 顶和底之间至少有 1 根 K 线相隔
- 笔分为向上笔和向下笔

### 4. 线段 (Line Segment)

- 由奇数笔组成(至少 3 笔)
- 前三笔必须有重叠部分
- 分为向上线段和向下线段

### 5. 中枢 (Pivot)

- 某级别走势中,被至少三个连续次级别走势所重叠的部分
- 对笔来说:至少三笔重叠
- 对线段来说:至少三段重叠

### 6. 背驰 (Divergence)

- 没有趋势就没有背驰
- 比较相邻两段的 MACD 柱面积
- c 段面积 < b 段面积 = 背驰

---

## 使用方法

```bash
# 分析单只股票(自动生成图表和报告)
python3 scripts/chanlun_analysis.py 601688

# 指定时间周期
python3 scripts/chanlun_analysis.py 601688 --period 60

# 输出 JSON 数据
python3 scripts/chanlun_analysis.py 601688 --json

# 指定输出目录
python3 scripts/chanlun_analysis.py 601688 --output ./reports
```

### 参数说明

| 参数 | 说明 | 默认值 |
|------|------|--------|
| `stock_code` | 股票代码(如 601688) | 必填 |
| `--period` | 周期:daily/60/30 等 | daily |
| `--output` | 输出目录 | ./outputs |
| `--json` | 额外输出 JSON 格式 | 否 |
| `--verbose` | 详细输出 | 否 |

> **注意**: 图表 PNG 是必需输出,无需额外参数,每次分析自动生成。

---

## 输出内容

每次分析**自动生成**以下文件:

### 1. 技术分析报告 (Markdown)

报告结构(**核心结论优先**):

| 章节 | 内容 |
|------|------|
| **🎯 核心结论** | 走势判断、背驰信号、操作建议、关键价位 |
| **📊 缠论分析图表** | PNG 图表展示 |
| **📋 分项统计** | 行情概况、分型统计、笔分析、中枢分析、背驰检测 |
| **⚠️ 风险提示** | 免责声明 |

### 2. 缠论可视化图表 (PNG) - 必需输出

图表内容:
- **主图**: K 线图 + 分型标记 (T=顶分型, B=底分型) + 笔连接 + 线段区域 + 中枢区域
- **副图 1**: MACD 指标 (柱状图 + DIF 线 + DEA 线)
- **副图 2**: 成交量柱状图

**图表元素说明**:

| 元素 | 颜色/样式 | 说明 |
|------|----------|------|
| Bullish Candle | 🔴 红色 | 收盘价≥开盘价(阳线) |
| Bearish Candle | 🟢 绿色 | 收盘价<开盘价(阴线) |
| Top Fractal (T) | 🟢 绿色圆圈 | 顶分型,局部高点 |
| Bottom Fractal (B) | 🔴 红色圆圈 | 底分型,局部低点 |
| Up Stroke | 🔵 蓝色实线 | 向上笔,从底到顶 |
| Down Stroke | 🟣 紫色虚线 | 向下笔,从顶到底 |
| Pivot Zone | 🟡 黄色区域 | 中枢,至少3笔重叠区间 |
| Segment | 浅色背景 | 线段区域 |

### 3. 输出文件

| 文件 | 说明 |
|------|------|
| `{stock_code}_chanlun_chart.png` | 缠论分析图表 |
| `{stock_code}_chanlun_report.md` | 技术分析报告 |

### 3. JSON 数据结构

```json
{
  "stock_code": "601688",
  "trend": "uptrend",
  "fractals": {
    "tops_count": 8,
    "bottoms_count": 7
  },
  "strokes_count": 12,
  "segments_count": 3,
  "pivots_count": 2,
  "divergence": {
    "detected": true,
    "type": "bullish",
    "confidence": 0.75
  }
}
```

---

## 买卖点定义

### 第一类买卖点
- 趋势背驰后形成的转折点
- 下跌趋势底背驰 → 第一类买点
- 上涨趋势顶背驰 → 第一类卖点

### 第二类买卖点
- 第一类买卖点后的第一次回抽
- 不回前低/前高形成

### 第三类买卖点
- 突破中枢后的回抽
- 回抽不进入中枢区间

---

## 环境要求

### 🔑 Tushare 数据源配置

本技能依赖 **Tushare Pro** 作为数据源,需要预先配置 API Token。

#### Tushare 注册要求

| 项目 | 说明 |
|------|------|
|

_meta.json

{
  "ownerId": "kn7fw4bnhsaf250vztqhw0t6js81z2pe",
  "slug": "chanlun-technical-analysis",
  "version": "1.0.0",
  "publishedAt": 1774595593068
}

skill-card.md

## Description:

基于缠中说禅理论为 A 股股票自动识别分型、笔、线段、中枢和背驰,并生成技术分析报告与可视化图表。

This skill is for research and development only.

## Publisher:

[laigen](https://clawhub.ai/user/laigen)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and technically skilled market researchers can use this skill to run ChanLun-style A-share analysis from a stock code and produce chart-backed Markdown reports. The generated analysis is for learning and research use and should not be treated as investment advice.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill requires a Tushare Pro API token and the packaged documentation suggests storing it in shell startup files.

Mitigation: Use a restricted virtual environment and provide the token only for the active session or through a managed secret store; avoid writing TUSHARE_TOKEN to ~/.bashrc.

Risk: The security evidence reports an under-disclosed automatic Yahoo Finance fallback, which may send stock queries to an additional external service.

Mitigation: Review network behavior before use and remove or explicitly control the fallback if only Tushare access is expected.

Risk: The generated technical analysis can include operational trading suggestions even though the artifact disclaims investment advice.

Mitigation: Treat outputs as research material and review results alongside independent financial analysis before making decisions.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/laigen/skills/chanlun-technical-analysis)
- [Tushare Pro registration](https://tushare.pro/register)

## Skill Output:

**Output Type(s):** [Markdown, Files, Code, Shell commands, Guidance]

**Output Format:** [Markdown report, PNG chart, optional JSON, and command-line guidance]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Requires a stock code, supports period and output-directory options, and writes generated artifacts under the configured output directory.]

## Skill Version(s):

1.0.0 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

skill.json

{
  "id": "787cc847-8070-49a0-a9e6-c1c85133e30e",
  "name": "chanlun-technical-analysis",
  "version": "2.0.0",
  "description": "ChanLun technical analysis skill for A-shares. Automatically identifies fractals, strokes, segments, pivots, and divergences based on ChanZhongShuoChan theory. Generates analysis reports and visualization charts.",
  "author": "laigen",
  "created": "2026-03-20",
  "updated": "2026-03-27",
  "tags": ["technical-analysis", "chanlun", "stock-analysis", "fractal", "divergence", "pivot"],
  "entry": "scripts/chanlun_analysis.py",
  "triggers": [
    "缠论分析",
    "技术分析",
    "股票形态分析",
    "顶底分型",
    "笔线段中枢",
    "背驰检测",
    "MACD背驰",
    "趋势判断",
    "买卖点识别"
  ],
  "env": {
    "required": ["TUSHARE_TOKEN"],
    "optional": []
  },
  "dependencies": {
    "pip": [
      "pandas>=1.5.0",
      "numpy>=1.20.0",
      "matplotlib>=3.5.0",
      "tushare>=1.2.0"
    ]
  },
  "sideEffects": {
    "readsFiles": true,
    "writesFiles": true,
    "networkAccess": true,
    "externalServices": ["Tushare API"]
  },
  "security": {
    "requiresApproval": false,
    "sensitiveData": false,
    "riskLevel": "low"
  },
  "output": {
    "formats": ["markdown", "png", "json"],
    "location": "./outputs/",
    "description": "Always generates PNG chart and Markdown report. JSON optional with --json flag."
  },
  "usage": {
    "example": "python3 scripts/chanlun_analysis.py 601688",
    "parameters": {
      "stock_code": {
        "type": "string",
        "required": true,
        "description": "Stock code (e.g., 601688, 300750)"
      },
      "period": {
        "type": "string",
        "default": "daily",
        "description": "Time period (daily, 60, 30)"
      },
      "output": {
        "type": "string",
        "default": "./outputs",
        "description": "Output directory"
      },
      "json": {
        "type": "boolean",
        "default": false,
        "description": "Additional JSON format output"
      },
      "verbose": {
        "type": "boolean",
        "default": false,
        "description": "Verbose output"
      }
    }
  }
}

Sponsored

Ads related to 技术分析-缠论 and adjacent AI workflows.