Skip to content

Chan Theory Pattern Recognition

Spot Chan Theory (Chanlun) price patterns and buy/sell points in OHLCV candle data using the czsc library.

Stars
37,433
Licence
MIT
Files
8 files

What it does

This skill teaches an agent to analyse price charts using Chan Theory, a Chinese technical analysis method based only on price structure. The agent can identify candlestick fractals, strokes (bi), and pivot zones (zhongshu), then label possible first, second and third buy or sell points. It relies on the czsc Python library to do the detection and works on any market that provides open, high, low, close and volume data.

Great for

  • Quantitative traders or analysts who already follow Chan Theory and want automated pattern labelling
  • Developers building a trading signal pipeline who want a starting point using czsc
  • Students learning Chan Theory who want examples and reference notes in Chinese

Skip it if

  • Anyone expecting reliable profit predictions: the signals are pattern labels from a discretionary theory, not guaranteed outcomes, and trading them can lose money
  • Users without Python and the czsc library installed, since the skill is code-driven and the setup is non-trivial
  • Investment decisions made without backtesting and risk controls, because the example engine is a simple illustration

Try asking

  • “Analyse this daily OHLCV CSV and tell me where the first buy and sell points appear under Chan Theory.”
  • “Identify the current pen (bi) and pivot zone (zhongshu) structure in this BTC-USDT hourly data.”
  • “Explain the difference between a second buy and a third buy point, with examples from my data.”
  • “Write a Python script that runs czsc on my futures data and outputs three-bi and five-bi pattern classifications.”
Step-by-step guide: how to use Chan Theory Pattern RecognitionInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 8 original files, the MIT licence and an attribution note.

    chanlun.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip chanlun.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip chanlun.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Provide bars in chronological order with consistent frequency, since the czsc analysis depends on correct sequencing.
  • Treat outputs as pattern labels to be validated with backtesting and risk management, not as trade instructions.
  • Read the linked reference notes (fractal, bi, zhongshu, buy/sell points) first if you are new to Chan Theory so the terminology in the output makes sense.

What's inside

  • example_signal_engine.py
  • references/买卖点/一买一卖.md
  • references/买卖点/三买三卖.md
  • references/买卖点/二买二卖.md
  • references/核心概念/中枢.md
  • references/核心概念/分型.md
  • references/核心概念/笔.md
  • SKILL.md

Redistributed unmodified from HKUDS/Vibe-Trading under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.