explaingit

axbiao/news-stock-selector

17PythonAudience · dataComplexity · 3/5LicenseSetup · hard

TLDR

A Claude Code skill that reads today's news, finds Chinese A-share stocks mentioned or implied, scores each one using sentiment and catalyst factors, and outputs a dark-theme HTML report with T1/T2/T3 tier rankings.

Mindmap

mindmap
  root((news-stock-selector))
    What it does
      News search
      Stock identification
      Price data fetch
      Tier ranking
    Scoring factors
      News sentiment
      Catalyst type
      Confidence level
      Trading strategy
    Data sources
      Xueqiu
      Tencent
      Sina
      EastMoney
      TuShare fallback
    Output
      HTML daily report
      T1 T2 T3 tiers
      Price tables
    Tech
      Python
      Claude Code
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Generate a daily ranked shortlist of Chinese A-share stocks based on that morning's news without manual research

USE CASE 2

Score stocks automatically using a five-factor formula that weights policy news and mergers above trending topics

USE CASE 3

Get a dark-theme HTML trading report saved to your desktop and opened in a browser with one Claude Code command

Tech stack

PythonClaude Code

Getting it running

Difficulty · hard Time to first run · 1h+

Requires a TuShare API token for market data and must run inside Claude Code with Python 3.10 or newer, targets Chinese A-share market only.

Free to use, modify, and distribute for any purpose, including commercial use, with no restrictions (MIT).

In plain English

This is a Claude Code skill that reads news and market updates, then identifies Chinese A-share stocks (companies listed on the Shanghai and Shenzhen exchanges) that may be worth watching based on what the news says. It is designed to run inside Claude Code as an add-on command rather than as a standalone application. The skill works in five steps. First it searches for recent news using web search tools. Then it identifies which specific stocks are mentioned or implied by the stories, standardizing each one to its official stock code and name. Next it fetches current market price data for those stocks through a chain of six data sources: if the first source (Xueqiu) fails or is unavailable, it automatically tries the next one (Tencent, then Sina, then EastMoney, then two levels of TuShare). This fallback chain means the skill can still get data even if some sources are down. Once it has the data, it scores each stock using a formula that combines five factors: the sentiment level of the news (how positive or negative), the type of catalyst (policy support and mergers score highest, while trending topics and analyst ratings score lower), how confident and timely the catalyst is, and what trading strategy the situation suggests. Stocks that hit the limit-up price on the previous day are automatically capped at the lowest tier regardless of their formula score. The result is a three-tier ranking: T1 for strong picks, T2 for stocks worth watching, and T3 for stocks to track but not prioritize. The final step generates an HTML daily report in a dark trading-terminal visual style. The report shows an overview of how many stocks were found and at what tiers, followed by tables for each tier with price data and strategy tags. It also includes outlook notes and a disclaimer. The file is saved to the desktop and opened in a browser automatically. The project is written in Python, requires Python 3.10 or newer, and is licensed under MIT. It was built specifically for the Chinese A-share market and assumes the user has access to a TuShare data API token.

Copy-paste prompts

Prompt 1
Run the news-stock-selector skill in Claude Code and generate today's A-share stock report. Summarize the T1 picks and explain why each one scored at the top tier.
Prompt 2
The news-stock-selector gave this stock a T2 score: [stock name/code]. Explain what catalyst type it detected and what trading strategy the tool suggested for it.
Prompt 3
I want to add a new data source to the news-stock-selector fallback chain after TuShare. Write the Python function that fetches the current price from [new source API] and slots it in as the sixth fallback.
Prompt 4
How does news-stock-selector handle a stock that hit the limit-up price yesterday? Show me where in the scoring logic it gets capped to T3.
Prompt 5
Extend the news-stock-selector HTML report to include a candlestick sparkline for each stock using Chart.js. Write the template changes needed.
Open on GitHub → Explain another repo

← axbiao on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.