chanlun

chanlun is a skill for Claude Code, Codex from HKUDS/Vibe-Trading. It costs 87 tokens per session (1,430 once invoked), scanned A, original, MIT.

A price-chart pattern detector based on Chan theory, a Chinese technical-analysis method. It identifies turning points, trend segments, overlapping price zones, and named buy or sell signals from OHLCV market data.

In plain words
What is it for?
Use it to scan stocks, cryptocurrencies, or futures for Chan-theory patterns and buy or sell signals. It supports patterns made of 3, 5, 7, 9, or 11 trend segments.
Why use it?
It turns a multi-step chart-reading process into repeatable calculations instead of requiring manual pattern marking. It can compare patterns across several time periods.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to scan stocks, cryptocurrencies, or futures for Chan-theory patterns and buy or sell signals. It supports patterns made of 3, 5, 7, 9, or 11 trend segments.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hkuds/vibe-trading/chanlun
About the project

Vibe-Trading is a personal trading agent that gives an AI system tools for market analysis, algorithmic trading, backtesting, and related workflows. It is for users who want an agent to research and evaluate trading strategies or manage simulated and other trading activities. The catalogue contains skills that expose these trading capabilities to compatible agents.

HKUDS/Vibe-Trading · 33,177 stars · on GitHub · vibetrading.wiki

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HKUDS/Vibe-Trading --skill chanlun
Clone the repo
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for chanlun

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/vibe-trading/chanlun/github.svg)](https://agentmods.dev/skills/hkuds/vibe-trading/chanlun)
Your own site
<a href="https://agentmods.dev/skills/hkuds/vibe-trading/chanlun"><img src="https://agentmods.dev/badge/skills/hkuds/vibe-trading/chanlun/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for chanlun

Your own site · 80×15
<a href="https://agentmods.dev/skills/hkuds/vibe-trading/chanlun"><img src="https://agentmods.dev/badge/skills/hkuds/vibe-trading/chanlun.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,430 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Fable 5.1 · 6 Sept 2026 📄 Read the review Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00087 $0.01430
Opus 5 $0.00044 $0.00715
Sonnet 5 $0.00017 $0.00286
Haiku 4.5 $0.00009 $0.00143

Measured 7d ago against content hash 9e4800c5d434, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

chanlun scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (example_signal_engine.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agent/src/skills/chanlun/SKILL.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

缠论形态识别

用途

基于缠中说禅理论的价格形态识别。缠论是一套完全基于价格结构的技术分析方法,核心链路:

原始K线 → 去包含处理 → 分型识别 → 笔检测 → 中枢构建 → 买卖点判定

适用于任何有 OHLCV 数据的市场(A股、加密货币、期货等)。

核心概念

概念 说明 详细文档
分型(FX) 顶分型:中间K线最高;底分型:中间K线最低 分型
笔(BI) 相邻顶底分型之间的一段走势,最小单元
中枢(ZS) 至少3笔构成的价格重叠区域,趋势的核心 中枢

买卖点体系

买卖点 含义 详细文档
一买/一卖 趋势结束后的第一个反转信号(背驰点) 一买一卖
二买/二卖 一买/一卖后回调不破底/顶的确认信号 二买二卖
三买/三卖 中枢上移/下移后回调不进入前中枢的信号 三买三卖

依赖安装

pip install czsc requests pandas

快速上手

from czsc import CZSC, RawBar, Freq
from datetime import datetime

# 准备 RawBar 列表(需按时间正序排列)
bars = [
    RawBar(symbol="BTC-USDT", id=0, dt=datetime(2026,1,1),
           freq=Freq.D, open=70000, close=71000,
           high=72000, low=69000, vol=1000, amount=71000000),
    # ... 更多K线
]

# 创建分析器,自动检测分型/笔/中枢
c = CZSC(bars)

# 访问结果
print(c.bi_list)    # 已完成的笔
print(c.bars_ubi)   # 未完成笔中的K线

可用信号函数(czsc.signals.cxt)

czsc 内置 43 个缠论信号函数,核心如下:

函数 说明 类型
cxt_first_buy_V221126 一买信号 买卖点
cxt_first_sell_V221126 一卖信号 买卖点
cxt_second_bs_V230320 均线辅助二买二卖 买卖点
cxt_third_bs_V230318 均线辅助三买三卖 买卖点
cxt_third_buy_V230228 笔三买辅助 买卖点
cxt_double_zs_V230311 两中枢组合判断BS1 中枢
cxt_three_bi_V230618 三笔形态分类 形态
cxt_five_bi_V230619 五笔形态分类 形态
cxt_seven_bi_V230620 七笔形态分类 形态
cxt_nine_bi_V230621 九笔形态分类 形态
cxt_eleven_bi_V230622 十一笔形态分类 形态
cxt_bi_base_V230228 BI基础信号(方向/转折) 基础
cxt_bi_end_V230312 MACD辅助笔结束 辅助
cxt_range_oscillation_V230620 区间震荡判断 辅助
cxt_zhong_shu_gong_zhen_V221221 大小级别中枢共振 中枢

信号约定

  • 信号引擎输出:1=做多,-1=做空,0=观望
  • 做多条件:一买信号 或 三笔向上盘背 或 五笔类一买
  • 做空条件:一卖信号 或 三笔向下盘背 或 五笔类一卖
  • 中枢辅助:价格在中枢下沿附近做多优势,上沿附近做空优势

Read the full file on GitHub · 111 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed 9e4800c5d434
  2. 11d ago First seen · 111 lines · 87 tokens per session scan A a8c6a42939af

Subscribe to this mod's changes

chanlun is a skill published in the GitHub repository HKUDS/Vibe-Trading (33,177 stars, last pushed yesterday), licensed MIT. It adds 87 tokens to every session and 1,430 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

hyperliquid

Use when backtesting, deploying, checking funding readiness, or debugging a Hyperliquid strategy through Superior Trade Unified API — writing Freqtrade configs and strategy code, running sweeps, checking managed-wallet balances, trading HIP-3 perps, or diagnosing a deployment that will not start or trade.

Superior-Trade/superior-skills · 64 tokens

polymarket

Use when the user wants to trade, research, or backtest Polymarket prediction markets through Superior Trade — finding markets by slug or event URL, placing a single immediate market order, writing NautilusTrader strategies, running filled-data backtests, funding pUSD, or deploying and monitoring a live Polymarket…

Superior-Trade/superior-skills · 68 tokens

aerodrome

Use when creating, validating, backtesting, deploying, sizing, or troubleshooting Aerodrome/Base spot trading strategies through the Superior Trade API, especially Freqtrade configs using exchange.name "aerodrome", AERO/USDC or CHECK/USDC pairs, AMM market swaps, wallet/gas balance checks, no-orderbook pricing, or…

Superior-Trade/superior-skills · 83 tokens

backtesting

Use when running, interpreting, or designing backtests on Superior Trade — anything about backtest windows, trade-count thresholds, exit-reason mix, parameter sweeps, walk-forward validation, zero-trade diagnosis, compute-cost estimation, or "is this backtest result trustworthy?". Pair with the relevant strategy…

Superior-Trade/superior-skills · 73 tokens

basis-arb

Use when the user asks for spot-perp basis trade, basis arbitrage, cash-and-carry, perp discount, or any setup that reads the spot–perp basis as a positioning signal. Long-perp leg only — pure two-leg basis arb requires a paired spot short (or long) which Freqtrade can't run cleanly. The strategy below captures the…

Superior-Trade/superior-skills · 87 tokens

fees-optimizations

Use when the user asks about fees, fee optimization, slippage, maker vs taker, post-only or ALO orders, fee tiers, builder code fees, effective spread, order pricing, lowering trading costs, or why a live Hyperliquid Freqtrade strategy underperforms its backtest. Also use proactively for high-turnover designs (5m or…

Superior-Trade/superior-skills · 94 tokens