Motivation
2026-04 聯發科 (+100%) 與 4985 臻鼎-KY (+100%) 的拉升若能在 2-3 日前看到「資金流 + 新聞密度 + 題材熱度」同時異常,就能提前佈局。目前平台只有事後分析,無事前訊號層。
Proposed signal (3 independent factors, 2-of-3 trigger)
- 資金流 z-score — 近 5 日 (外資 + 投信) 累計買超,相對過去 60 日 5d-rolling-sum 分布的 z。
|z| ≥ 2.0 觸發。
- 新聞密度 z-score — 近 7 日
news_items 中該 ticker 出現次數,相對過去 90 日基準的 z。z ≥ +2.0 觸發 (只取上尾)。
- Wikilink 共現熱度 — 近 7 日
news_items 中與該 ticker 同時出現的 distinct [[wikilink]] 數。>= 5 觸發。
任一 ticker 2/3 因子同時觸發 → 寫入 signal_alerts 表 + 當日 markdown 摘要 (analysis/signals/YYYY-MM-DD.md),並 upsert 到 news_items (source='ticker_signal') 讓 MCP/Claude.ai 查得到。
Design
完整計畫見 docs/plans/2026-05-05-signal-layer.md。摘要:
- 新表: `signal_alerts (trade_date, ticker, flow_z, news_z, wikilink_heat, factors_hit, composite, details JSONB)` — migration 004。
- 新模組: `ingestion/snapshots/ticker_signal.py` (參照現有 `overnight_signal.py` 與 `tpu.py` 的 builder pattern)。
- Cron: `0 17 * * 1-5` Asia/Taipei,盤後 30 分;institutional_stock 應已 ingest 完。
- Reuse: `scripts/verify_flow_zscore.py` 的 z-score 公式 (single source of truth) + `mcp_server/tools/market.py` 的 trading-timescaledb 連線。
Acceptance criteria
Out of scope
- Push 通知 (Slack/email/iOS) — 待 signal 穩定後另開 issue
- Intraday cadence — 等日線層先驗證有效再考慮
- 圖譜版 wikilink heat — `news_items.wikilinks` TEXT[] 已足夠,圖譜版延後
Reference
- 起源討論: 2026-05-05 conversation about MediaTek / 4985 missed setups
- 計畫文件: `docs/plans/2026-05-05-signal-layer.md`
Motivation
2026-04 聯發科 (+100%) 與 4985 臻鼎-KY (+100%) 的拉升若能在 2-3 日前看到「資金流 + 新聞密度 + 題材熱度」同時異常,就能提前佈局。目前平台只有事後分析,無事前訊號層。
Proposed signal (3 independent factors, 2-of-3 trigger)
|z| ≥ 2.0觸發。news_items中該 ticker 出現次數,相對過去 90 日基準的 z。z ≥ +2.0觸發 (只取上尾)。news_items中與該 ticker 同時出現的 distinct[[wikilink]]數。>= 5觸發。任一 ticker 2/3 因子同時觸發 → 寫入
signal_alerts表 + 當日 markdown 摘要 (analysis/signals/YYYY-MM-DD.md),並 upsert 到news_items(source='ticker_signal') 讓 MCP/Claude.ai 查得到。Design
完整計畫見
docs/plans/2026-05-05-signal-layer.md。摘要:Acceptance criteria
Out of scope
Reference