Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

zigzag-pattern-classifier锯齿形模式分类器

Agent Skill

zigzag-pattern-classifier 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

541

周安装

23

GitHub Stars

37

下载量

190
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:zigzag-pattern-classifier(锯齿形模式分类器)
来源仓库:https://github.com/terrylica/cc-skills
仓库路径:skills/zigzag-pattern-classifier
安装命令:
npx skills add https://github.com/terrylica/cc-skills --skill zigzag-pattern-classifier
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/terrylica/cc-skills --skill zigzag-pattern-classifier

简介

zigzag-pattern-classifier 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 建议结合原始 README 核验具体用法和功能边界。

SKILL.md

ZigZag Swing Pattern Classifier

Complete taxonomy for classifying ZigZag swing patterns by structure and market regime. Every confirmed ZigZag sequence maps to exactly one variant — no gaps, no overlaps.

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

When to Use

  • Classifying a confirmed L₀→H₁→L₂ (two-pivot) or L₀→H₁→L₂→H₃ (three-pivot) swing
  • Looking up market regime implications of a specific pattern
  • Answering "how many distinct patterns exist?" and proving exhaustiveness
  • Implementing pattern labeling in code (Rust qta crate, Python pipelines)
  • Understanding the epsilon tolerance band that defines "equal"
  • Applying Freedman-Diaconis binning for sub-classification depth

Notation (Single Source of Truth)

SymbolDefinitionExample
L₀Initial low (first confirmed pivot)1.0800
H₁Swing high (reversal peak)1.0850
L₂Second low (retracement)1.0810
H₃Second high (three-pivot only)1.0870
WSwing magnitude: H₁ − L₀0.0050
zNormalized retracement: (L₂ − L₀) / (H₁ − L₀)0.20
oVolatility-normalized overshoot: (L₀ − L₂) / ATR₁₄0.35
εTolerance band for "equal" classification5 pips
τZigZag reversal threshold6.6 pips

Price Level Comparisons

CodeMeaningCondition
HLHigher LowL₂ > L₀ + ε
ELEqual Low\L₂ − L₀\≤ ε
LLLower LowL₂ < L₀ − ε
HHHigher HighH₃ > H₁ + ε
EHEqual High\H₃ − H₁\≤ ε
LHLower HighH₃ < H₁ − ε

Part 1: Two-Pivot Patterns (UP-DOWN)

Pattern: L₀ → H₁ → L₂ (one up-leg, one down-leg)

Base Classification (3 Classes)

Every UP-DOWN triplet falls into exactly one:

ClassConditionMeaningFrequency
EL\L₂ − L₀\≤ εEqual Low (retest)~20–30%
HLL₂ > L₀ + εHigher Low (pullback)~50–60%
LLL₂ < L₀ − εLower Low (undercut)~10–20%

Granular Classification: 9 FD-Binned Variants

HL and LL each decompose into 4 sub-classes using Freedman-Diaconis binning on normalized coordinates:

  • HL bins use z = (L₂ − L₀) / (H₁ − L₀), ranging 0 to 1
  • LL bins use o = (L₀ − L₂) / ATR₁₄, ranging 0 to ∞
Variantz or o RangeMarket RegimeProbability
EL\z\≤ ε_rRetest — support re-established20–30%
HL-FD10.75 < z < 1.0Shallow pullback — buyers in control20–25%
HL-FD20.50 < z ≤ 0.75Moderate pullback — Fib 38–50%15–20%
HL-FD30.25 < z ≤ 0.50Deep pullback — Fib 61.8%10–15%
HL-FD40 < z ≤ 0.25Near-complete retrace — barely held5–10%
LL-FD1o ≤ q₂₀Micro undercut — brief false break8–12%
LL-FD2q₂₀ < o ≤ q₄₀Shallow undercut — moderate panic4–8%
LL-FD3q₄₀ < o ≤ q₆₀Deep undercut — structural break2–5%
LL-FD4o > q₆₀Extreme undercut — tail event<2%

Trading Implications

VariantEntry SignalStop LossTarget
ELLong from L₀+εL₀−εH₁ + ΔH
HL-FD1Long from L₂L₂−εH₁ + ΔH
HL-FD2Long at confirmationL₂−εPrior H + ΔH
HL-FD3Reduced size; waitL₂−εSupport + ΔH
HL-FD4Extreme risk; avoidL₂−εCritical
LL-FD1Short spike tradeL₂+spikeL₀
LL-FD2Wait for reversalBreakoutL₀
LL-FD3Short continuationReversalNew lows
LL-FD4Crisis mode; hedgeCapitulationTBD

Optional Sub-Classification Flags

Attach to any variant for richer context:

FlagMeaningSignal
+CAny close < L₀ between H₁→L₂Stronger bearish commitment
+SL₂ occurs in single bar (spike)Sharp reversal; mean reversion
+XWicks below L₀ only, no closeLiquidity grab; false break

Example labels: HL-FD2+C, LL-FD4+S+C, EL+X


Part 2: Three-Pivot Patterns (UP-DOWN-UP)

Pattern: L₀ → H₁ → L₂ → H₃ (up-leg, down-leg, up-leg)

9 Exhaustive Variants

Two independent dimensions × 3 values each = 3×3 = 9 mutually exclusive, collectively exhaustive variants.

Dimension 1 — L₂ vs L₀: {HL, EL, LL} Dimension 2 — H₃ vs H₁: {HH, EH, LH}

#L₂ vs L₀H₃ vs H₁NameMarket Regime
1HLHHContinuation impulseBull trend continuation
2HLEHDouble-top testRange, bullish bias
3HLLHTriangle compressionNeutral consolidation
4ELHHRange break upBullish transition
5ELEHRectangleBalanced range
6ELLHLower-high at flat baseRange, bearish bias
7LLHHV-reversal / springBullish reversal
8LLEHUndercut then stallVolatile range
9LLLHRally failureBear trend continuation

Exhaustiveness Proof

All variants satisfy these mandatory constraints:

  • L₀ < H₁ (first uptrend exists)
  • L₂ < H₁ (retracement doesn't exceed peak)
  • H₃ > L₂ (second uptrend exists)

L₂ has exactly 3 relationships to L₀ (higher, equal, lower). H₃ has exactly 3 relationships to H₁ (higher, equal, lower). These dimensions are independent — no constraint eliminates any combination. Therefore 3 × 3 = 9 variants, all feasible, none missing.

Natural Groupings

  • Bullish (4): HL+HH, EL+HH, HL+EH, LL+HH
  • Neutral (3): HL+LH, EL+EH, LL+EH
  • Bearish (2): EL+LH, LL+LH

Regime Assignments

RegimeVariants
Trend ContinuationHL+HH (bull), LL+LH (bear)
Range ConsolidationHL+LH, EL+EH, LL+EH
Bullish TransitionEL+HH, HL+EH
Bearish TransitionEL+LH
ReversalLL+HH

Part 3: 27-Way Extension

Adding H₃ vs L₀ as a third independent dimension:

  • L₂ vs L₀: {HL, EL, LL}
  • H₃ vs H₁: {HH, EH, LH}
  • H₃ vs L₀: {Above, Equal, Below}

This yields 3×3×3 = 27 sub-variants. Some are mathematically impossible due to constraints (e.g., HL+LH+H₃<L₀ requires H₃ < L₀ < L₂ < H₃, a contradiction).

Analysts often simplify this third dimension to a binary: "reclaims L₀" vs "fails to reclaim L₀".


The Epsilon Tolerance Band

The tolerance band ε determines what "equal" means. It adapts to volatility and microstructure.

Core Formula

ε = min(ε_max, max(ε_min, √[(a·S)² + (b·ATR₁₄)²]))

Where:

  • S = rolling median spread (bid-ask)
  • ATR₁₄ = 14-bar Average True Range
  • a = 2.0 (spread scaling)
  • b = 0.05 (M5-M30) or 0.07 (H1-D1)

Bounds (EURUSD defaults)

ε_min = max(3 ticks, 1×S) = max(0.00003, S)
ε_max = min(5 pips, 0.20 × swing) = min(0.00050, 0.20 × W)

Classification Using ε

ε_r = ε / W  (relative tolerance)

EL if |z| ≤ ε_r
HL if z > ε_r
LL if z < −ε_r

Practical Fallbacks

If bid-ask spread unavailable:

  • ATR-only: ε = 0.05 × ATR₁₄ (M5-M30), 0.07 × ATR₁₄ (H1-D1)
  • Fixed band: ε = 3 pips (intraday), 5 pips (swing), 10 pips (daily)

For complete worked examples with sensitivity analysis, read references/epsilon-tolerance-detail.md.


Freedman-Diaconis Binning

The FD rule computes statistically optimal bin edges from data:

h = 2 × IQR(X) × n^(-1/3)    (bin width)
K = clip(⌈(max−min) / h⌉, 3, 6)  (number of bins)
edges = linspace(min, max, K+1)

Procedure for HL Patterns

  1. Collect 2-3 years of UP-DOWN triplets
  2. Filter to HL (z > ε_r)
  3. Winsorize z at 0.5%-99.5%
  4. Compute FD bin edges on z ∈ (ε_r, 1)
  5. Label: HL-FD1 (shallowest) through HL-FDK (deepest)

Procedure for LL Patterns

  1. Filter to LL (z < −ε_r)
  2. Compute o = (L₀ − L₂) / ATR₁₄
  3. Winsorize o at 0.5%-99.5%
  4. Compute FD bin edges on o ∈ (ε_r, ∞)
  5. Label: LL-FD1 (micro) through LL-FDK (extreme)

Recompute bin edges monthly or quarterly to track regime drift. Fall back to quantile binning if sample < 400.


Implementation Reference

The qta Rust crate (crates/qta/) implements the core ZigZag state machine that produces the pivots consumed by this classification framework:

  • ZigZagConfig::new(reversal_depth, epsilon_multiplier, bar_threshold_dbps)
  • ZigZagState::process_bar(&bar) → ZigZagOutput with completed_segment containing base_class (EL/HL/LL) and z score
  • The crate computes τ and ε dynamically per pivot from bar_threshold_dbps

The classification framework in this skill extends the crate's output with FD-binning, three-pivot analysis, and market regime labeling.


Deep Reference Files

For ASCII visualizations, worked examples, and implementation pseudocode, read these reference files as needed:

FileContents
references/notation-definitions.mdSingle source of truth: all symbols, formulas, abbreviations, pattern classes
references/two-pivot-variants.mdAll 9 two-pivot ASCII diagrams, trading rules, flag examples
references/three-pivot-variants.mdAll 9 three-pivot ASCII diagrams, 27-way extension, HL+LH granular sub-variants
references/epsilon-tolerance-detail.mdComplete ε formula, worked calculation, sensitivity analysis, pseudocode
references/binning-methodology.mdFreedman-Diaconis algorithm details, FD vs quantile comparison, worked example
references/data-pipeline.md11-step end-to-end pipeline: raw quotes → OHLC → ATR → pivots → classify → output
references/eurusd-validation-scenarios.md3 worked market scenarios (Normal, Volatile, Crash) validating ε and τ

Post-Execution Reflection

After this skill completes, check before closing:

  1. Did the command succeed? — If not, fix the instruction or error table that caused the failure.
  2. Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
  3. Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.

Only update if the issue is real and reproducible — not speculative.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.54%
按下载量换算71

Claude

26.76%
按下载量换算51

Cursor

17.98%
按下载量换算34

Gemini CLI

9.76%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills