SuperAPI AI Directory

screen-stocks

General & other

View repository

Updated 10-15 23:33

About this skill

Undervalued Stock Screening Skill

Parse $ARGUMENTS to determine region, preset, and sector, then execute the following command.

Execution Command

python3 /Users/kikuchihiroyuki/stock-skills/.claude/skills/screen-stocks/scripts/run_screen.py --region <region> --preset <preset> [--sector <sector>] [--theme <theme>] [--top <N>] [--mode <query|legacy>]

Natural Language Routing

For natural language → skill determination, refer to .claude/rules/intent-routing.md .

Available Region Codes (yfinance EquityQuery)

Major regions: jp, us, sg, th, my, id, ph, hk, kr, tw, cn, gb, de, fr, in, au, br, ca, etc. (about 60 regions)

Available Exchange Codes

Exchange Code
Tokyo Stock Exchange JPX
NASDAQ NMS
NYSE NYQ
Singapore Exchange SES
Stock Exchange of Thailand SET
Bursa Malaysia KLS
Indonesia Stock Exchange JKT
Philippine Stock Exchange PHS
Hong Kong Stock Exchange HKG
Korea Exchange KSC/KOE
Taiwan Stock Exchange TAI

Theme Screening (KIK-439)

--theme <テーマ> can be combined with any preset to perform screening focused on a specific theme. trending/pullback/alpha Presets are --theme not supported.

Theme Key Description Target Industries (Excerpt)
ai AI/Semiconductors Semiconductors, Software—Infrastructure, Electronic Components
ev EV/Next-Generation Vehicles Auto Manufacturers, Electrical Equipment & Parts
cloud-saas Cloud/SaaS Software—Application, Software—Infrastructure
cybersecurity Cybersecurity Software—Infrastructure (Security-Focused)
biotech Biotech/Drug Discovery Biotechnology, Drug Manufacturers
renewable-energy Renewable Energy Solar, Utilities—Renewable
fintech Fintech Software—Application (Finance-Focused), Capital Markets
defense Defense/Space Aerospace & Defense
healthcare Healthcare/Medical Devices Medical Devices, Health Information Services

Theme definitions are managed in config/themes.yaml .

Trend Theme Auto-Detection (KIK-440)

--auto-theme is specified, trend themes are automatically detected via the Grok API (X/Web search), and existing screening is executed sequentially for each theme.

Pipeline

  1. Grok API detects 3–5 notable themes from X/Web (with confidence scores)
  2. themes.yaml and only valid themes are executed (unsupported themes are skipped with notification)
  3. Execute screening with the specified preset for each theme

Constraints

  • --auto-theme と --theme are mutually exclusive (cannot be used simultaneously)
  • trending/pullback/alpha Cannot be used together with presets
  • XAI_API_KEY Required (exits with an error if not set)

trending Differences from presets

--preset trending --auto-theme
Detection Target Trending on XIndividual Stocks Trend'sTheme/Sector
Granularity Stock-level granularity Theme-level granularity
Screening Fundamentals Evaluation Evaluated with any preset within the theme

Execution Examples

# 日本のトレンドテーマで割安株をスクリーニング
python3 .../run_screen.py --region japan --preset value --auto-theme

# 米国のトレンドテーマで高成長株
python3 .../run_screen.py --region us --preset high-growth --auto-theme

# グローバルのトレンドテーマでデフォルトプリセット
python3 .../run_screen.py --preset value --auto-theme

Screening Mode

  • --mode query (Default): EquityQuery Method. Uses the yfinance EquityQuery API to directly search for stocks matching conditions without needing a stock list. Supports all regions. Fast.
  • --mode legacy: Stock List Method. Uses the conventional ValueScreener. Fetches and evaluates a predefined list of stocks (Nikkei 225, S&P 500, etc.) one by one. Supports only japan/us/asean.
  • --with-pullback: Add pullback filter. Applies technical pullback detection additionally to any preset (value, high-dividend, etc.).--preset pullback . It is not necessary to specify it together with . (The pullback preset takes precedence.) Output uses the same column format as Pullback mode.

Preset

  • value : Traditional value investing (low PER, low PBR, ROE >= 5%)
  • high-dividend : High-dividend stocks (dividend yield 3% or higher)
  • growth : Pure growth stocks (high ROE >= 15%, revenue growth >= 10%. No PER constraint. Selected by growth potential regardless of undervaluation)
  • growth-value : Growth value (growth potential + undervaluation)
  • deep-value : Deep value (very low PER/PBR)
  • quality : Quality value (high ROE >= 15% + undervalued. A superset of value with the ROE threshold tightened from 5% to 15%. Limited to highly profitable undervalued stocks)
  • pullback : Pullback buying type (enter on a temporary correction during an uptrend. A 3-stage pipeline of EquityQuery -> technical -> SR. Execution takes time)
  • alpha : Alpha signal (integration of 3 axes: undervaluation + quality of change + pullback. A 4-stage pipeline of EquityQuery -> quality of change -> pullback detection -> 2-axis scoring. Execution takes time)
  • trending : X trend stocks (discover trending stocks on X with the Grok API -> evaluate fundamentals with Yahoo Finance.--theme You can narrow down themes with . Requires XAI_API_KEY)
  • long-term : Long-term investment suitability (high ROE >= 15%, EPS growth >= 10%, dividend >= 2%, PER <= 25, PBR <= 3, market cap >= 100 billion. Searches for stable growth stocks suitable for long-term holding)
  • shareholder-return : Shareholder return focus (ranked by total payout ratio of dividend yield + buyback yield. With stability assessment: ✅Stable/📈Increasing/⚠️Temporary/📉Declining)
  • high-growth : High-growth stocks (profit not required, revenue growth rate >= 20%, most recent quarterly revenue growth >= 10%, PSR <= 20, gross margin >= 20%. Loss-making growth companies are also eligible. Uses PSR instead of PER to prevent bubbles) (KIK-432)
  • small-cap-growth : Small-cap rapid-growth stocks (market cap <= 100 billion, revenue growth rate >= 20%, PSR <= 15, gross margin >= 20%. Ten-bagger candidates undiscovered by institutional investors. With automatic market cap adjustment by region. Risk ★★★★) (KIK-437)
  • contrarian : Contrarian candidates (technically oversold × undervalued valuation × solid fundamentals. 3-axis 100-point scoring. The opposite of a value trap, detecting 'excessive market reaction') (KIK-504)
  • momentum : Momentum surge stocks (4-axis scoring of RSI/MACD/volume surge/trend alignment. Detects stocks in an uptrend.--submode You can choose stable acceleration or surge with ) (KIK-506)

Momentum screening details (KIK-506)

3-stage momentum classification

Classification Condition Description
🟢 Accelerating (accelerating) Score 40–69 Stable upward momentum. No sense of overheating and high continuity
🟡 Surge (surge) Score 70–89 Sharp price increase. Short-term attention is high, but beware of a correction
🔴 Overheated Score 90–100 Overheated state. High returns can be expected, but there is correction risk

--submode Parameters

--submode You can narrow down the classifications displayed.

Value Display target Recommended use case
stable(Default) 🟢 Accelerating only When you want to select stocks in a stable uptrend
surge 🟡 Surge + 🔴 Overheated When you want to include short-term surging stocks

4-axis scoring

Axis Full score Judgment condition
RSI strength 25 RSI ≧ 60
MACD Cross 25 MACD > signal line (bullish cross)
Momentum rate 25 20-day price change rate exceeds the threshold
Volume surge 25 5-day average volume / 20-day average volume ≧ 1.3

A total score ≧ 40 is judged as a momentum stock.

Output

Display the results in Markdown table format. In EquityQuery mode, a sector column is added.

Output columns in EquityQuery mode

Rank / Stock / Sector / Stock price / PER / PBR / Dividend yield / ROE / Score

Output columns in Legacy mode

Rank / Stock / Stock price / PER / PBR / Dividend yield / ROE / Score

Output columns in Pullback mode

Rank / Stock / Stock price / PER / Pullback % / RSI / Volume ratio / SMA50 / SMA200 / Score

Output columns in Alpha mode

Rank / Stock / Stock price / PER / PBR / Undervalued / Change / Overall / Pullback / A / Acceleration / FCF / ROE trend

Output columns in Growth mode

Rank / Stock / Sector / Stock price / PER / PBR / EPS growth / Sales growth / ROE

Output columns in Trending mode

Rank / Stock / Reason for being talked about / Stock price / PER / PBR / Dividend yield / ROE / Score / Judgment

Output columns in Contrarian mode

Rank / Stock / Stock price / PER / PBR / RSI / SMA200 deviation / Tech / Value / Fundamentals / Overall / Judgment

Output columns in Momentum mode

Rank / Stock / Stock price / PER / RSI / MACD / Momentum rate / Volume ratio / Momentum score / Overall score / Classification

Output columns in Shareholder Return mode

Rank / Stock / Stock price / Dividend yield / Share buyback yield / Total payout ratio / Stability / ROE / PER

Execution example

# 日本の割安株(デフォルト)
python3 .../run_screen.py --region japan --preset value

# 米国の高配当テクノロジー株
python3 .../run_screen.py --region us --preset high-dividend --sector Technology

# 香港のバリュー株
python3 .../run_screen.py --region hk --preset value

# ASEAN の成長バリュー株(sg, th, my, id, ph を順次実行)
python3 .../run_screen.py --region asean --preset growth-value

# Legacy モードで米国株をスクリーニング
python3 .../run_screen.py --region us --preset value --mode legacy

# 日本株の押し目買い候補
python3 .../run_screen.py --region japan --preset pullback

# 日本株のアルファシグナル(割安+変化+押し目)
python3 .../run_screen.py --region japan --preset alpha

# 米国株のアルファシグナル
python3 .../run_screen.py --region us --preset alpha

# 日本の割安株 + 押し目フィルタ
python3 .../run_screen.py --region japan --preset value --with-pullback

# 米国の高配当株 + 押し目フィルタ
python3 .../run_screen.py --region us --preset high-dividend --with-pullback

# X (Twitter) で話題の日本株
python3 .../run_screen.py --region japan --preset trending

# X で話題のAI関連米国株
python3 .../run_screen.py --region us --preset trending --theme "AI"

# X で話題の半導体関連銘柄
python3 .../run_screen.py --region japan --preset trending --theme "半導体"

# 日本の長期投資候補
python3 .../run_screen.py --region japan --preset long-term

# 米国の長期投資候補
python3 .../run_screen.py --region us --preset long-term

# 日本の純成長株(割安制約なし)
python3 .../run_screen.py --region japan --preset growth

# 米国の純成長株
python3 .../run_screen.py --region us --preset growth

# 日本の高還元株
python3 .../run_screen.py --region japan --preset shareholder-return

# 米国の高還元株
python3 .../run_screen.py --region us --preset shareholder-return

# 米国の高成長株(利益不問・PSR基準)
python3 .../run_screen.py --region us --preset high-growth

# 日本の高成長株
python3 .../run_screen.py --region japan --preset high-growth

# AI関連の割安株(米国)
python3 .../run_screen.py --region us --preset value --theme ai

# 半導体の高成長株(米国)
python3 .../run_screen.py --region us --preset high-growth --theme ai

# 防衛関連株(米国・割安)
python3 .../run_screen.py --region us --preset value --theme defense

# EV関連の成長株(米国)
python3 .../run_screen.py --region us --preset growth --theme ev

# バイオテックの高成長株
python3 .../run_screen.py --region us --preset high-growth --theme biotech

# 日本の小型急成長株(時価総額1000億以下)
python3 .../run_screen.py --region japan --preset small-cap-growth

# 米国の小型急成長株(時価総額$1B以下に自動調整)
python3 .../run_screen.py --region us --preset small-cap-growth

# AI関連の小型成長株
python3 .../run_screen.py --region us --preset small-cap-growth --theme ai

# 日本の逆張り候補(売られすぎ × ファンダ堅調)
python3 .../run_screen.py --region japan --preset contrarian

# 米国の逆張り候補
python3 .../run_screen.py --region us --preset contrarian

# テクノロジーセクターの逆張り候補
python3 .../run_screen.py --region japan --preset contrarian --sector Technology

# 日本の急騰・モメンタム銘柄(安定加速のみ、デフォルト)
python3 .claude/skills/screen-stocks/scripts/run_screen.py --preset momentum --region japan --top 10

# 米国の急騰銘柄を含むモメンタムスクリーニング(急騰・過熱も含む)
python3 .claude/skills/screen-stocks/scripts/run_screen.py --preset momentum --region us --top 5 --submode surge

# テクノロジーセクターのモメンタム銘柄
python3 .../run_screen.py --region japan --preset momentum --sector Technology

Annotation feature (KIK-418/419)

Markers based on investment notes and sale history are automatically added to screening results.

Marker legend

Marker Meaning Trigger
⚠️ Concern note present Investment note type=concern
📝 Lesson note present Investment note type=lesson
👀 Wait and see Investment note type=observation + keywords such as "pass" or "wait"

Automatic exclusion of sold stocks

Stocks sold within the last 90 days are automatically excluded from the screening results. The number of exclusions will be shown in a message.

Data Source

  1. Neo4j Knowledge Graph (preferred)
  2. JSON file (fallback when Neo4j is not connected)

Prior Knowledge Integration Rules (KIK-466)

If the output of get_context.py contains the following, integrate it with the screening results and respond:

  • Frequent stocks (SURFACED 3 or more times): "Top-ranked 3 times in a row → stably undervalued. Detailed report recommended"
  • Held stocks: If screening results include held stocks, "Currently held: material for considering additional investment"
  • Concern notes: If there is a concern note for a resulting stock, append "⚠️ Concern note present"
  • Sold: If a sold stock appears in the top ranks again, "Previously sold → consider re-entry"