Skip to content
Back to skills

tw-market-breadth

ASecurity

台股市場寬度健康度評分(0-100)。用 FinMind 計算上市(或上櫃)普通股站上 200 日均線的比例,產生 tradermonty market-breadth-analyzer 相容的 CSV,再用原版 6 分項評分。當使用者問「台股漲勢健不健康」「是不是只有權值股在撐」「市場寬度」「多少股票站上 200 日線」「大盤和個股背離」時使用。需要 FINMIND_API_TOKEN,以及已安裝的 tradermonty market-breadth-analyzer skill。

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 12, 2026
ai-agentspythonbashgitapi

Works with

  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 12, 2026

npx -y skills add HoMuChen/tw-market-breadth-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of tw-market-breadth?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for tw-market-breadth
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/homuchen-tw-market-breadth/badge)](https://www.skillsdirectory.com/skills/homuchen-tw-market-breadth)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tw-market-breadth
description: 台股市場寬度健康度評分(0-100)。用 FinMind 計算上市(或上櫃)普通股站上 200 日均線的比例,產生 tradermonty market-breadth-analyzer 相容的 CSV,再用原版 6 分項評分。當使用者問「台股漲勢健不健康」「是不是只有權值股在撐」「市場寬度」「多少股票站上 200 日線」「大盤和個股背離」時使用。需要 FINMIND_API_TOKEN,以及已安裝的 tradermonty market-breadth-analyzer skill。
---

# 台股市場寬度(tradermonty market-breadth-analyzer 台股版)

## 這個 skill 做什麼

把 tradermonty 的 market-breadth-analyzer 從美股(S&P 500)搬到台股:

- **資料層換掉**:用 FinMind 算每天「收盤價 > 200 日均線」的股票比例(Breadth Index)
- **評分層不動**:直接呼叫原版的 6 分項評分(水準與趨勢 25%、8MA/200MA 交叉 20%、高低點循環 20%、空頭訊號 15%、歷史百分位 10%、指數與寬度背離 10%)
- 欄位 `S&P500_Price` 放的是**加權指數**收盤,欄名沿用只是為了相容

輸出是「市場健康度」的觀察,不是買賣訊號,也不是投資建議。

## 前置條件

- Python 3.9+,套件:`pandas`、`scipy`、`requests`
- 環境變數 `FINMIND_API_TOKEN`
- 已安裝 tradermonty 的 market-breadth-analyzer(https://github.com/tradermonty/claude-trading-skills ),環境變數 `TRADERMONTY_SKILL` 指向它的資料夾

## 執行流程

### Step 1:產生資料並評分

這個 skill 安裝在 `~/.claude/skills/tw-market-breadth/`(若裝在專案的 `.claude/skills/`,請改用對應路徑):

```bash
TRADERMONTY_SKILL=~/.claude/skills/market-breadth-analyzer \
  bash ~/.claude/skills/tw-market-breadth/scripts/run_tw_breadth.sh twse reports/tw-breadth-$(date +%F)
```

- `twse` = 上市普通股;`tpex` = 上櫃
- 全上市約 1,200 檔,每檔一次 FinMind 請求。免費版註冊後每小時 600 次,全上市要分兩個多小時;付費版可以設 `FINMIND_WORKERS=8` 並行抓
- 預設用還原股價 `TaiwanStockPriceAdj`(Backer 以上才有)。**免費版**請設 `FINMIND_PRICE_DATASET=TaiwanStockPrice`
- 可以先用 `--stocks 2330,2317,...` 小量測試:

```bash
python3 ~/.claude/skills/tw-market-breadth/scripts/build_tw_breadth.py \
  --source finmind --stocks 2330,2317,2454 --fetch-start 2024-01-01 --start 2025-01-01 --out-dir /tmp/tw-test
```

### Step 2:讀報告

讀 `reports/.../market_breadth_*.md`,用繁體中文向使用者說明:

1. 綜合分數與健康區間(Health Zone)
2. 最強、最弱的分項,各用一句話解釋原因
3. 目前站上 200 日線的股票比例(Breadth_Index_Raw)與 8MA、200MA
4. 有沒有在 Pink Zone(200MA 下彎且 8MA < 200MA)
5. 指數與寬度是否背離(指數漲、寬度跌最需要注意)

## 解讀原則

- 寬度是「參與度」:加權指數可以被少數權值股撐住,寬度看的是多數股票有沒有跟上
- 報告裡的 Equity Exposure 是原作者對美股的經驗區間,台股只當參考,不要直接當成持股比例
- 門檻(0.4、0.6、0.7)沿用原版,是 S&P 500 的經驗值;台股的歷史高低點平均值可以看 summary CSV

## 已知限制

- `--stocks twse` 用目前掛牌清單,不含已下市股,有倖存者偏差(早年的寬度會偏高一點)
- 預設用還原股價(TaiwanStockPriceAdj)計算,避免除權息造成假跌破;免費版用未還原股價時,除權息旺季(7–9 月)的寬度可能偏低
- 這是市場環境觀察工具,不產生買賣訊號

Files in this skill

  • SKILL.md3.5 KB
  • requirements.txt39 B
  • scripts/build_tw_breadth.py9.8 KB
  • scripts/run_tw_breadth.sh1.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.