跳到正文
cccskills
免费在 GitHub 公开

Pattern Skill

Detects chart patterns in OHLC data from natural-language hypotheses or visual chart selections.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md6.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Pattern Skill

Purpose

Turn a trader's pattern idea — either written in natural language or drawn directly on the chart — into a runnable JavaScript detection script that scans the active OHLC dataset and returns match regions. Vibe Trade loads the script into the code editor, runs it against the data, and surfaces results in the Pattern Analysis bottom-panel tab.

This skill is the go-to for any "find me X in the price history" question.

When to use this skill

Vibe Trade should dispatch to the Pattern Skill when the user:

  • Describes a known technical pattern by name — "bull flag", "double bottom", "head and shoulders", "ascending triangle", "breakout", etc.
  • Has just drawn a region on the chart via the pattern selector (a serialized SHAPE: [...] fingerprint arrives as the user's message)
  • Asks for a custom indicator — "RSI smoothed with a 20 EMA", "momentum oscillator with z-score normalization", etc.
  • Pastes Pine Script code and asks for a JavaScript equivalent

Instructions

  1. If the message is a fingerprint (contains SHAPE: and Sliding window):

    • First analyze the shape — what pattern does it resemble, what's the trend, the volatility, the implied direction?
    • Ask the user for confirmation before generating a detection script.
    • The chat router stores the fingerprint as context.pending_fingerprint and waits for a yes/proceed before dispatching again.
  2. If the message confirms a pending fingerprint (context.pending_fingerprint is set and the user said yes), generate a shape-matching script:

    • Use Pearson correlation with threshold 0.50 — NOT 0.85+. Strict thresholds silently produce zero matches, which looks like the skill is broken.
    • Fall back to returning the top 5 candidates regardless of threshold.
    • Emit script_editor.load with the generated JS.
    • Emit bottom_panel.activate_tab → pattern_analysis.
  3. If the message is a named pattern ("bull flag", "double bottom"):

    • Generate a detection script using price-structure rules, not shape correlation.
    • Use forgiving thresholds (3–5% tolerance, not 1%).
    • Emit the same two tool_calls as above.
  4. If the message is an indicator request ("custom RSI...", "ATR-based stop"):

    • Generate an indicator script that returns an array of values (or null for insufficient data).
    • Wrap the result as script_type: "indicator" so the frontend registers it in the Resources dropdown.
  5. If the user already has a script loaded and asks for a modification (edit mode — context.pattern_script is non-empty):

    • Return the modified script in full.
    • Do NOT switch the view to Code — the user is iterating and wants the chat feedback inline.

Inputs

KeyTypeMeaning
messagestringNatural-language description or SHAPE fingerprint
context.pending_fingerprintstringPreviously-analyzed fingerprint awaiting confirmation
context.pattern_scriptstringExisting script — triggers edit-mode
context.dataset_idstringActive dataset id (used when running the script)

Outputs

Returns a SkillResponse with:

  • reply — short plain-language explanation of the script
  • script — the generated JavaScript source
  • script_type — "pattern" / "indicator" / "pine_convert"
  • data.parameters — parameter hints extracted from the script
  • data.indicators_used — list of indicator helpers referenced
  • data.default_params / data.indicator_name — indicator mode only
  • tool_calls — see below

Tools used

This skill may emit any of the following tool_calls:

ToolWhenPayload
chart.pattern_selectorUser asks to "mark a pattern" or similartrue to open, false to close
chart.highlight_matchesAfter a successful run with matchesPatternMatch[]
chart.draw_markersTo annotate specific barsMarker[]
chart.focus_rangeTo zoom the chart to a match region{startTime, endTime}
script_editor.loadAlways, when a script is generatedThe JS source string
script_editor.runWhen the user asks "run it now"—
bottom_panel.activate_tabAfter generating a script"pattern_analysis"
bottom_panel.set_dataTo push results into a tab's store slot{target, data}
notify.toastNon-blocking status ("Found 7 matches"){level, message}

Examples

Natural-language input

"Find bull flags after a 5% rally."

→ Returns a script that scans for a strong uptrend followed by a consolidation in a downward-sloping channel, with 3% tolerance on the flag bounds. Script loads into the editor; bottom panel switches to Pattern Analysis.

Indicator input

"Custom RSI smoothed with a 20-period EMA."

→ Returns an indicator function with default_params = {rsi_period: 14, ema_period: 20}. The frontend registers it in Resources and enables it on the chart.

Fingerprint input (from chart.pattern_selector)

Find this 285-bar pattern (scale-free): SHAPE: [0.02, 0.25, 0.67, ...] Sliding window: 285 bars

→ First pass: analyze the shape, ask for confirmation. → On confirmation: generate a correlation-based detector with threshold 0.50 and fallback-to-top-5 so the user always has something to look at.

Underlying implementation

This skill is wired through core/agents/processors.py::_pattern_processor, which calls core/agents/pattern_agent.py::PatternAgent.generate. The agent owns PATTERN_SYSTEM_PROMPT, INDICATOR_SYSTEM_PROMPT, and PINE_CONVERT_PROMPT.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Fetch historical OHLC chart data from yfinance (stocks) or ccxt (crypto) and load it onto the chart.

中文简介正在准备中。当前显示原文说明。

spyderweb47/Vibe-Trade162026年4月22日 更新

Research historical news events that moved (or are moving) an asset's price and plot them as data points directly on the chart. Click a marker in the Historic News tab to zoom the chart to that event and read the article. Useful for identifying the fundamental drivers behind price action — earnings, regulation, product launches, macro shocks, geopolitical events.

中文简介正在准备中。当前显示原文说明。

spyderweb47/Vibe-Trade162026年4月22日 更新

One-sentence description of what this skill does. Shown as a tooltip on the chip.

中文简介正在准备中。当前显示原文说明。

spyderweb47/Vibe-Trade162026年4月22日 更新

Runs a team of 50 LLM personas through a 30-round structured debate to predict market direction. Uses the Canvas Agent Swarm Service — the same shared infrastructure other skills use for smaller agent teams. Output is an influence-weighted consensus direction + trade recommendation with a transparent record of every argument, research query, and cross-examination.

中文简介正在准备中。当前显示原文说明。

spyderweb47/Vibe-Trade162026年4月22日 更新

Generates and analyzes trading strategies from a structured config. Produces runnable JS + portfolio analysis.

中文简介正在准备中。当前显示原文说明。

spyderweb47/Vibe-Trade162026年4月22日 更新

查看 spyderweb47 的全部技能

报告此技能的问题