Skip to content
Agentmart
Submit a tool

a-share-trend-following

A股趋势跟踪策略/趋势强度分析。当用户说"趋势跟踪"、"trend following"、"趋势交易"、"顺势"、"趋势强度"、"ADX"、"均线策略"、"海龟策略"、"突破策略"时触发。基于 cn-stock-data…

Skill by aifinlab

IndexedApache-2.0★ 261
Write a review

Chalk Labs

Need help deploying a-share-trend-following?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/aifinlab-a-share-trend-following

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

A股趋势跟踪策略/趋势强度分析。当用户说"趋势跟踪"、"trend following"、"趋势交易"、"顺势"、"趋势强度"、"ADX"、"均线策略"、"海龟策略"、"突破策略"时触发。基于 cn-stock-data 获取K线数据,构建趋势跟踪策略,分析趋势强度和方向。支持研报风格(formal)和快速分析风格(brief)。

Use cases: data, finance

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/a-share-trend-following

What's inside

Skill name
a-share-trend-following
Description
A股趋势跟踪策略/趋势强度分析。当用户说"趋势跟踪"、"trend following"、"趋势交易"、"顺势"、"趋势强度"、"ADX"、"均线策略"、"海龟策略"、"突破策略"时触发。基于 cn-stock-data 获取K线数据,构建趋势跟踪策略,分析趋势强度和方向。支持研报风格(formal)和快速分析风格(brief)。
License
Apache-2.0
Instructions
76 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (3)

  • SKILL.md
  • trend-following-guide.md · references/
  • trend_follower.py · scripts/

SKILL.md (first lines)

# A股趋势跟踪策略 (a-share-trend-following)

## 数据获取

通过 cn-stock-data skill 获取K线数据:
- 日K线:至少 120 个交易日(均线计算需要足够回溯期)
- 周K线:可选,用于多周期共振确认
- 调用方式:`cn-stock-data` kline 接口,获取 OHLCV 数据

## 分析流程

### Step 1: 获取K线数据
- 使用 cn-stock-data 获取目标股票日K线(默认 250 日)
- 保存为 JSON 供 `scripts/trend_follower.py` 使用

### Step 2: 计算趋势指标
运行脚本:
```bash
python scripts/trend_follower.py --data kline.json --method all --fast 20 --slow 60
```

核心指标体系:
| 指标 | 用途 | 默认参数 |
|------|------|---------|
| SMA/EMA 交叉 | 趋势方向判定 | fast=20, slow=60 |
| ADX/DMI | 趋势强度量化 | period=14 |
| Donchian Channel | 突破信号 | period=20 |
| ATR Trailing Stop | 动态止损 | period=14, multiplier=2.0 |

### Step 3: 趋势状态判定
根据指标综合判定当前趋势regime:
- **强上升趋势**: ADX>25 且 +DI>-DI 且价格在均线上方
- **弱上升趋势**: 价格在均线上方但 ADX<25
- **震荡/无趋势**: ADX<20,均线缠绕
- **弱下降趋势**: 价格在均线下方但 ADX<25
- **强下降趋势**: ADX>25 且 -DI>+DI 且价格在均线下方

### Step 4: 生成交易信号与回测
- 策略可选:`ma_cross`(均线交叉)、`donchian`(突破)、`turtle`(海龟)、`all`(综合)
- 回测指标:累计收益、年化收益、Sharpe ratio、最大回撤、胜率、盈亏比、Profit Factor

### Step 5: 输出结果

## A股特殊考量
- **T+1 制度**: 买入当日不可卖出,信号需延迟一日执行
- **涨跌停板**: 涨停无法买入 / 跌停无法卖出,需检测涨跌停状态
- **停牌缺口**: 停牌后复牌可能跳空,ATR 止损需特殊处理
- **印花税**: 卖出 0.05%(2024年起),佣金双边 0.025%

## 输出风格

### formal(研报风格)
```
## 趋势跟踪分析报告:{股票名称}({代码})
### 一、趋势状态总览
### 二、趋势指标详情
### 三、交易信号与策略
### 四、回测绩效
### 五、风险提示与操作建议
```

### brief(快速分析风格)
```
{股票名称} 趋势跟踪速览
趋势状态: 强上升 | ADX={value}
当前信号: 持有/买入/卖出/观望
关键价位: 止损={x} 止盈={y}
近期绩效: 胜率={w}% Sharpe={s}
```

## 注意事项
- 趋势策略在震荡市中容易产生频繁假信号(whipsaw),需结合 ADX 过滤
- 单一策略不构成投资建议,应结合基本面和市场环境综合判断
- 回测结果不代表未来表现,注意过拟合风险

From aifinlab/FinClaw, Apache-2.0.

More from aifinlab/FinClaw

Signals

Stars
261
Forks
39
Open issues
2
Last commit (this folder)
Mar 26, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from aifinlab

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get a-share-trend-following running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying a-share-trend-following?

CallGet help
Cite this page

a-share-trend-following skill. Agent Mart. https://agentmart.dev/skills/aifinlab-a-share-trend-following (last updated 2026-10-24)