Elliott Wave Analysis
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
Technical timing skill that positions a stock within its Elliott Wave cycle, confirms with momentum, and contextualizes with market environment. Three modules run sequentially; each result feeds the next.
When to Use
| Trigger | Example |
|---|---|
| Wave position inquiry | "TSLA.US 现在是第几浪" / "700.HK波浪分析" |
| Technical timing | "NVDA.US 技术择时" / "苹果波浪择时" |
| Pre-trade check | "我想买,波浪角度看合适吗" |
| General wave theory | "帮我做个艾略特波浪分析" |
Do not trigger if: the user requests fundamental analysis, earnings preview, or valuation — use the relevant skill instead.
Data Sources
All price data comes from the Longbridge CLI. Before the first invocation of any
longbridge subcommand in a session, run longbridge <subcommand> --help to confirm
available flags, required arguments, and symbol format. Do this for every distinct
subcommand you use (e.g. kline, quote, capital, news).
What to fetch
| Data | Purpose | Minimum |
|---|---|---|
| Daily K-line | Primary wave analysis | ≥ 250 bars, JSON |
| Weekly K-line | Higher-degree wave context | ~100 bars, JSON |
| Current quote | Latest price, range | JSON |
| Capital flow | Southbound / Northbound flow (if available) | JSON |
Symbol validation
Not all ticker-like strings are valid on Longbridge — index codes (e.g. SPX, HSI) are
not tradable securities and will return invalid symbol. When you need broad-market
data, use a tracking ETF instead (e.g. SPY.US for S&P 500, 2800.HK for HSI). If
uncertain whether a symbol is supported, test with a small kline query first and handle
the error gracefully.
Practical notes
- Always redirect CLI output to a temp file (e.g.
/tmp/kline_day.json) — the CLI may append version notices to stdout that break JSON parsing. - Use
--format jsonon every call so output is machine-readable. - Market environment data not available in CLI → use Web Search (see Module C).
Workflow
Step 1 — Pre-flight checks
Before analysis, verify:
- Run
longbridge kline --helpandlongbridge news --helpif you haven't already in this session. - Fetch ≥ 300 daily candles for the target symbol in JSON format; save to a temp file.
- Count returned bars. If < 250 bars → refuse analysis, reply:
- CN: "历史数据不足250根日K,波浪计数不可靠,建议选择数据更充足的标的。"
- EN: "Fewer than 250 daily candles available — wave count unreliable."
- Fetch the 5 most recent news items for the symbol. If recent suspension/resumption or confirmed fraud/delisting → refuse.
- For A-share: if ticker has "ST" prefix → refuse.
Step 2 — Module A: Wave Cycle Identification
Run scripts/signal_engine.py to compute swing points, wave count, and Fibonacci zones:
python3 scripts/signal_engine.py --kline /tmp/kline_day.json --symbol SYMBOL
The script outputs JSON with:
stage: wave stage label (see Stage Labels below)count_a/count_b: two candidate count scenariosagreed: true if both counts give the same stage conclusionfib_zones: dict of Fibonacci price levelsswings: list of recent swing points
If agreed is false → output "结构待确认 / Structure Unconfirmed", do not force a stage label.
Stage Labels (translate to user's language):
| Internal | Simplified CN | Traditional CN | English |
|---|---|---|---|
impulse_early | 上升初段 | 上升初段 | Early Impulse |
impulse_wave3 | 主升段(③浪) | 主升段(③浪) | Wave 3 Advance |
impulse_late | 上升末段(⑤浪) | 上升末段(⑤浪) | Late Impulse (Wave 5) |
top_zone | 顶部区域 | 頂部區域 | Top Zone |
corrective_abc | 调整段(ABC) | 調整段(ABC) | ABC Correction |
bottom_zone | 底部区域 | 底部區域 | Bottom Zone |
unconfirmed | 结构待确认 | 結構待確認 | Structure Unconfirmed |
Step 3 — Module B: Momentum Confirmation
Compute from the same daily K-line data (all calculable from OHLCV, no extra API calls):
| Indicator | Parameters | Signal to Report |
|---|---|---|
| MACD | 12/26/9 EMA | Line vs signal, histogram direction, divergence vs price |
| RSI | 14-period | Level (>70 overbought / <30 oversold), divergence vs price |
| Volume | Raw volume | Wave 3 highest volume? Wave 5 / C-wave volume vs prior wave |
| MA trend | 20 / 50 SMA | Price above/below each MA; MA slope direction |
Critical divergence signals (must flag explicitly):
- Wave 5 top + MACD/RSI bearish divergence → high alert, potential reversal
- C-wave bottom + MACD/RSI bullish divergence → potential bottom
- Wave 3 + volume expansion → confirms wave 3 validity
Each indicator: state its current condition and whether it supports / is neutral toward / contradicts the Module A wave label. Do not sum into a single score.
Step 4 — Module C: Market Environment
Assess macro/market context relevant to the stock's market. Each signal is independent — do not aggregate into a score.
For CLI data in this module, run longbridge <subcommand> --help first if you haven't
already. Index codes are not valid symbols on Longbridge — use tracking ETFs instead
(see "Suggested proxy" column). If a proxy symbol returns an error, fall back to Web Search.
HK (HKEX)
| Signal | How to get | Suggested proxy | Web Search fallback |
|---|---|---|---|
| HSI trend (60-day) | longbridge kline — 60 daily bars | 2800.HK (Tracker Fund) | "恒生指数 今日" |
| Southbound flow | longbridge capital for the target symbol | — | "南向资金 今日净买入" |
| Short-sell ratio | Not in CLI | — | "[stock name] HK short selling ratio" |
| Recent policy / regulatory | — | — | Web Search |
US (NYSE/NASDAQ)
| Signal | How to get | Suggested proxy | Web Search fallback |
|---|---|---|---|
| S&P 500 trend (60-day) | longbridge kline — 60 daily bars | SPY.US | "S&P 500 price today" |
| VIX level | Not in CLI | — | "VIX current level" |
| Put/call ratio | Not in CLI | — | "CBOE equity put call ratio" |
| Sector ETF trend | longbridge kline — 30 daily bars | Relevant sector ETF (e.g. XLK.US, XLE.US) | Web Search |
A-share (SSE/SZSE)
| Signal | How to get | Suggested proxy | Web Search fallback |
|---|---|---|---|
| Shanghai Composite trend | longbridge kline — 60 daily bars | 000001.SH | "上证指数 今日" |
| Northbound flow | longbridge capital for the target symbol | — | "北向资金 今日" |
| Margin balance trend | Not in CLI | — | "融资余额" |
| Recent CSRC/policy signals | — | — | Web Search |
SGX
| Signal | How to get | Web Search fallback |
|---|---|---|
| STI trend | CLI coverage may be limited — try a proxy first, expect errors | "Straits Times Index today" |
| Stock-specific news | longbridge news for the target symbol | "[company] SGX news" |
If a data item is unavailable from both CLI and Web Search, note "数据不可用 / Data unavailable" for that item only. Do not skip the whole module.
Step 5 — Generate Output
Assemble the three-module result into the output template below.
Output Template
The output uses four sections written in natural language — no bullet dumps. Match the user's language (Simplified CN / Traditional CN / English) throughout.
【{Company Name}({SYMBOL})】波浪技术分析
分析日期:{today} | 当前价:{price} | 今日区间:{low} – {high}
【一】波浪结构
当前阶段
{stage_label_natural} · {one-line characterisation}
{2–3 paragraph prose narrative:}
- Para 1: Describe the swing sequence in plain language from the key bottom/origin,
naming each wave and the price/date of each pivot. Explain why the current move
matches the identified stage. Avoid jargon — translate wave numbers to meaning.
- Para 2: Confirm with a second counting perspective (different threshold / degree).
State whether both agree ("两套视角结论一致") or conflict ("结构待确认,建议观望").
- Para 3 (if unconfirmed): Explain what w