uptrend-analyzer について
MontyのUptrend Ratioデータを使って市場のブレッドスを分析し、市場全体とセクター別の参加度を0〜100のスコアとエクスポージャー指針で示すスキルです。無料のCSVで上昇の広がりを評価し、参加度やセクターローテーションを調べる分析者向けです。
主な機能
- 015項目のスコアリング
- 02市場全体とセクター参加度の分析
- 03セクターローテーションとモメンタムの評価
- 04ゾーン別エクスポージャー指針
- 05JSONとMarkdownレポートの生成
活用シーン
- 01相場上昇への参加の広がりを確認
- 02セクターごとの上昇トレンド比率を比較
- 03セクターローテーションとモメンタムを把握
- 04ブレッドススコアに基づきエクスポージャーを調整
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ tradermonty/ claude-trading-skills --skill uptrend-analyzerインストール後、Claude Code で/uptrend-analyzerを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
requirements.txtreferences/uptrend_methodology.mdscripts/data_fetcher.pyprovenance_contract.pyreport_generator.pyscorer.pyuptrend_analyzer.pyscripts/calculators/__init__.pyhistorical_context_calculator.pymarket_breadth_calculator.pymomentum_calculator.pysector_participation_calculator.pysector_rotation_calculator.pyscripts/tests/conftest.pyhelpers.pytest_data_fetcher_schema_drift.pytest_data_fetcher.pytest_historical_context_calculator.pytest_main_provenance.pytest_market_breadth_calculator.pytest_momentum_calculator.pytest_new_features.pytest_provenance_contract.pytest_report_generator.pytest_scorer.pytest_sector_participation_calculator.pytest_sector_rotation_calculator.pytest_uptrend_analyzer.py詳細
Uptrend Analyzer Skill
Purpose
Diagnose market breadth health using Monty's Uptrend Ratio Dashboard, which tracks ~2,800 US stocks across 11 sectors. Generates a 0-100 composite score (higher = healthier) with exposure guidance.
Unlike the Market Top Detector (API-based risk scorer), this skill uses free CSV data to assess "participation breadth" - whether the market's advance is broad or narrow.
When to Use This Skill
English:
- User asks "Is the market breadth healthy?" or "How broad is the rally?"
- User wants to assess uptrend ratios across sectors
- User asks about market participation or breadth conditions
- User needs exposure guidance based on breadth analysis
- User references Monty's Uptrend Dashboard or uptrend ratios
Japanese:
- 「市場のブレドスは健全?」「上昇の裾野は広い?」
- セクター別のアップトレンド比率を確認したい
- 相場参加率・ブレドス状況を診断したい
- ブレドス分析に基づくエクスポージャーガイダンスが欲しい
- Montyのアップトレンドダッシュボードについて質問
Prerequisites
- Python 3.9+ with the
requestslibrary (CSV parsing uses the stdlibcsv/iomodules) - Internet connection to fetch CSV data from GitHub (no API key required)
- No paid API subscriptions needed
Difference from Market Top Detector
| Aspect | Uptrend Analyzer | Market Top Detector |
|---|---|---|
| Score Direction | Higher = healthier | Higher = riskier |
| Data Source | Free GitHub CSV | FMP API (paid) |
| Focus | Breadth participation | Top formation risk |
| API Key | Not required | Required (FMP) |
| Methodology | Monty Uptrend Ratios | O'Neil/Minervini/Monty |
Execution Workflow
Phase 1: Execute Python Script
Run the analysis script (no API key needed):
python3 skills/uptrend-analyzer/scripts/uptrend_analyzer.py
The script will:
- Download CSV data from Monty's GitHub repository
- Calculate 5 component scores
- Generate composite score and reports
Phase 2: Present Results
Present the generated Markdown report to the user, highlighting:
- Composite score and zone classification
- Exposure guidance (Full/Normal/Reduced/Defensive/Preservation)
- Sector heatmap showing strongest and weakest sectors
- Key momentum and rotation signals
5-Component Scoring System
| # | Component | Weight | Key Signal |
|---|---|---|---|
| 1 | Market Breadth (Overall) | 30% | Ratio level + trend direction |
| 2 | Sector Participation | 25% | Uptrend sector count + ratio spread |
| 3 | Sector Rotation | 15% | Cyclical vs Defensive balance |
| 4 | Momentum | 20% | Slope direction + acceleration |
| 5 | Historical Context | 10% | Percentile rank in history |
Scoring Zones
| Score | Zone | Exposure Guidance |
|---|---|---|
| 80-100 | Strong Bull | Full Exposure (100%) |
| 60-79 | Bull | Normal Exposure (80-100%) |
| 40-59 | Neutral | Reduced Exposure (60-80%) |
| 20-39 | Cautious | Defensive (30-60%) |
| 0-19 | Bear | Capital Preservation (0-30%) |
7-Level Zone Detail
Each scoring zone is further divided into sub-zones for finer-grained assessment:
| Score | Zone Detail | Color |
|---|---|---|
| 80-100 | Strong Bull | Green |
| 70-79 | Bull-Upper | Light Green |
| 60-69 | Bull-Lower | Light Green |
| 40-59 | Neutral | Yellow |
| 30-39 | Cautious-Upper | Orange |
| 20-29 | Cautious-Lower | Orange |
| 0-19 | Bear | Red |
Warning System
Active warnings trigger exposure penalties that tighten guidance even when the composite score is high:
| Warning | Condition | Penalty |
|---|---|---|
| Late Cycle | Commodity avg > both Cyclical and Defensive | -5 |
| High Spread | Max-min sector ratio spread > 40pp | -3 |
| Divergence | Intra-group std > 8pp, spread > 20pp, or trend dissenters | -3 |
Penalties stack (max -10) + multi-warning discount (+1 when ≥2 active). Applied after composite scoring.
モメンタムの平滑化
スコアリングの前に、傾きの値を EMA(3)(指数移動平均、span=3)で平滑化します。加速度は、平滑化した傾きの直近10ポイントの平均と、それ以前の10ポイントの平均を比較して算出します(10対10のウィンドウ)。データポイントが20個未満の場合は、5対5に切り替えます。
過去データに基づく信頼度指標
Historical Context コンポーネントには、次の要素に基づく信頼度評価が含まれます。
- サンプルサイズ: 利用可能な過去のデータポイント数
- レジームのカバー範囲: 観測された異なる市場レジーム(強気/弱気/中立)の割合
- 新しさ: 最新のデータポイントがどの程度最近のものか
信頼度レベル:高、中、低。
API 要件
必須: なし(無料の GitHub CSV データを使用)
出力ファイル
- JSON:
uptrend_analysis_YYYY-MM-DD_HHMMSS.json - Markdown:
uptrend_analysis_YYYY-MM-DD_HHMMSS.md
参考ドキュメント
references/uptrend_methodology.md
- 上昇トレンド比率の定義としきい値
- 5コンポーネントのスコアリング手法
- セクター分類(景気循環、ディフェンシブ、コモディティ)
- 過去データによる調整に関する注記
参考資料を読み込むタイミング
- 初回使用時: フレームワーク全体を理解するため、
uptrend_methodology.mdを読み込みます - 通常の実行時: スコアリングはスクリプトが処理するため、参考資料は不要です
同一実行の来歴情報
--run-id daily-20261017-unique を、必須の market-regime-daily
プロデューサー 2つの両方に渡します。指定しない場合、各プロデューサーはそれぞれ固有の ID を生成します。JSON には、実際の主要時系列の営業日、UTC での取得時刻、ソース、実行 ID を含む schema 1.0 の data_provenance が含まれます。調整、時点整合性、サバイバーシップ、コーポレートアクションに関する不明フラグは false です。補助的なサマリーの日付は未検証のため、すべての複合入力データの鮮度を保証するものではありません。主要日付が欠落しているか、形式が不正な場合、レポート生成は停止します。
これらの実行で出力された JSON のパスをそのまま Exposure Coach の
--require-provenance --run-id … --as-of … モードに渡します。実行 ID は呼び出し元が指定する整合性確認用の識別子であり、真正性や時点整合性を証明するものではありません。