Agent skill

A Share Trend Following

by aifinlab in aifinlab/FinClaw

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

Apache-2.0Auto-check passed

Install A Share Trend Following

skills CLI
$ npx skills add aifinlab/FinClaw --skill a-share-trend-following -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aifinlab/FinClaw a-share-trend-following --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aifinlab/FinClaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/a-share-trend-following .claude/skills/a-share-trend-following && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
a-share-trend-following
GitHub stars
255
Token cost
~432 tokens
SKILL.md length
111 words
Files
3 (incl. scripts, references)
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

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

  • Works in 5 steps: 获取K线数据 → 计算趋势指标 → 趋势状态判定 → …
  • SKILL.md covers 数据获取, 分析流程, A股特殊考量 and 输出风格, plus 1 more section
  • Runs Python scripts from its folder; calls python

What it does

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

Its SKILL.md is about 430 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and reference files (for example `references/trend-following-guide.md` and `scripts/trend_follower.py`).

The licence is Apache-2.0.

Example prompts

  • “trend following”
  • “/a-share-trend-following”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. 获取K线数据
  2. 计算趋势指标
  3. 趋势状态判定
  4. 生成交易信号与回测
  5. 输出结果

What it can do on your machine

Read from SKILL.md and the folder at commit 9e62862. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

A Share Trend Following loads about 432 tokens when it runs, and up to ~2.2k if it reads all its reference files. Until then it costs about 48 tokens; SKILL.md has 111 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~432
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aifinlab/FinClaw at commit 9e62862, republished under its Apache-2.0 licence (© aifinlab). 111 words, ~432 tokens.

Download SKILL.mdSave it as .claude/skills/a-share-trend-following/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
a-share-trend-following
description
A股趋势跟踪策略/趋势强度分析。当用户说"趋势跟踪"、"trend following"、"趋势交易"、"顺势"、"趋势强度"、"ADX"、"均线策略"、"海龟策略"、"突破策略"时触发。基于 cn-stock-data 获取K线数据,构建趋势跟踪策略,分析趋势强度和方向。支持研报风格(formal)和快速分析风格(brief)。

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 过滤
  • 单一策略不构成投资建议,应结合基本面和市场环境综合判断
  • 回测结果不代表未来表现,注意过拟合风险

© aifinlab, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts, references) in skills/a-share-trend-following of aifinlab/FinClaw.

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

Open the folder on GitHubat commit 9e62862

Compare with similar skills

A Share Trend Following next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

A Share Trend Following compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
A Share Trend Following this skillaifinlab/FinClaw255—~432Automated safety check: PassApache-2.0
ShareClickHouse/ClickHouse50k—~558Automated safety check: NotesApache-2.0
Developing Share PagesTriliumNext/Trilium38k—~3.7kAutomated safety check: PassAGPL-3.0
SharingBuilderIO/agent-native7.1k—~3.4kAutomated safety check: PassNone
Deslop Shared Libsgarrytan/gstack136k—~3.3kAutomated safety check: NotesMIT
Apify Trend Analysissickn33/agentic-awesome-skills47k2 repos~1.2kAutomated safety check: NotesMIT

Similar skills

  • Share

    ClickHouse/ClickHouse

    Share a Claude Code session to pastila.nl and return a viewer link.

    50k GitHub stars~558 tokensUpdated today
    DatabasesAuto-check: notes
  • Developing Share Pages

    TriliumNext/Trilium

    A skill your agent uses when working on Trilium's share functionality — shared pages under /share/, the static HTML (share-theme) export, the share theme package (packages/share-theme: EJS…

    38k GitHub stars~3.7k tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Sharing

    BuilderIO/agent-native

    Framework-level sharing and privacy for user-authored resources (dashboards, documents, forms, decks, etc.).

    7.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Deslop Shared Libs

    garrytan/gstack

    Find worthwhile shared-code extractions in recent work. An agent skill from garrytan/gstack.

    136k GitHub stars~3.3k tokensUpdated today
    Writing & ContentAuto-check: notes
  • Apify Trend Analysis

    sickn33/agentic-awesome-skills

    Discover and track emerging trends across Google Trends, Instagram, Facebook, YouTube, and TikTok to inform content strategy.

    47k GitHub starsUsed in 2 repos~1.2k tokens
    Data & AnalyticsAuto-check: notes
  • Skill Share

    davila7/claude-code-templates

    A skill that creates new Claude skills and automatically shares them on Slack using Rube for seamless team collaboration and skill discovery.

    33k GitHub starsUsed in 10 repos~729 tokens
    Agent WorkflowsAuto-check passed

More from aifinlab/FinClaw

All 74 skills in this repo
  • Bank Corporate Credit Dd

    aifinlab/FinClaw

    A skill your agent uses when the user asks for help with corporate credit due diligence, enterprise credit investigation, pre-loan review, borrower analysis, document collection, management…

    255 GitHub stars~952 tokensUpdated 5 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank corporate-risk monitoring assistant for enterprise litigation/penalty/enforcement scanning (处罚/诉讼/被执行/失信等).

    255 GitHub stars~751 tokensUpdated 5 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank corporate client operating-volatility monitoring assistant (经营监测/指标波动/预警解释).

    255 GitHub stars~605 tokensUpdated 5 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank post-loan visit follow-up assistant to turn visit notes/materials into a structured memo (摘要/关键更新/风险观察/用途核验/行动项).

    255 GitHub stars~544 tokensUpdated 5 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank corporate credit issue-list assistant (问题清单/补件清单/催办台账).

    255 GitHub stars~487 tokensUpdated 5 mo ago
    Auto-check passed
  • A skill your agent uses when you need a bank corporate credit approval-opinion drafting assistant (审批意见/条款建议/有条件同意).

    255 GitHub stars~549 tokensUpdated 5 mo ago
    Auto-check passed

Questions about A Share Trend Following

What does A Share Trend Following do?

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

How do I install A Share Trend Following in Claude Code?

Run `npx skills add aifinlab/FinClaw --skill a-share-trend-following -a claude-code`. Or copy the skill folder (skills/a-share-trend-following in aifinlab/FinClaw) into .claude/skills/a-share-trend-following in your project. Claude Code loads it when a task matches its description.

How do I install A Share Trend Following in Codex?

Run `npx skills add aifinlab/FinClaw --skill a-share-trend-following -a codex`. Or copy the skill folder (skills/a-share-trend-following in aifinlab/FinClaw) into .agents/skills/a-share-trend-following in your project. Codex loads it when a task matches its description.

Can I use A Share Trend Following in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aifinlab/FinClaw --skill a-share-trend-following -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/a-share-trend-following, .gemini/skills/a-share-trend-following, .github/skills/a-share-trend-following and .opencode/skills/a-share-trend-following in your project.

What does A Share Trend Following need to run?

Going by SKILL.md and its folder, A Share Trend Following needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does A Share Trend Following access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is A Share Trend Following safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does A Share Trend Following use?

A Share Trend Following is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does A Share Trend Following use?

About 432 tokens (SKILL.md is roughly 1.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.8k tokens, read only when the agent opens those files.

What are the alternatives to A Share Trend Following?

Skills that share tags, products or a category with A Share Trend Following: Share (ClickHouse/ClickHouse, 50k stars), Developing Share Pages (TriliumNext/Trilium, 38k stars), Sharing (BuilderIO/agent-native, 7.1k stars) and Deslop Shared Libs (garrytan/gstack, 136k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains A Share Trend Following?

aifinlab (a GitHub user) maintains it in aifinlab/FinClaw, which has 255 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on May 13, 2026.

Source: aifinlab/FinClaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.