Content
Here is the translation of the provided document:
| | |
| --- | --- |
| Simplified Chinese | [English](./README.en.md) | [日本語](./README.ja.md) |
# Tool List
A stock analysis panel based on Vite + React.
Currently covering these pages and capabilities:
- Stock information
- Stock screener
- Limit up ladder
- Sector rotation
- Sentiment indicators
- Information gathering
- AI review
- Pre-market plan
- Skills
The project supports organizing your own review criteria, trading framework, and observation list into skills, and then injecting them into AI review, pre-market plan, individual stock observation, and research report summary.
See the full project manual: [Project Use Manual.md](./项目使用手册.md)
## Recent Updates
This round of updates mainly changed the structure and data chain.
- The front-end large page continues to be split into `container + hook + panel`
- High-frequency EastMoney requests are uniformly handled by the Python proxy/action layer
- The second data source `mootdx` has been connected to `K-line / basic market data / market breadth / index sequence`
- The back-end added cache, connection pool, thread pool, transaction context, exception handling, and authentication
- GitHub page added startup check update and manual check update
Detailed changes can be seen:
- [Update Document.md](./更新文档.md)
- [Service Reinforcement Description.md](./服务加固说明.md)
- [Second Data Source Description.md](./第二数据源说明.md)
<details>
<summary><strong>Expand to view recent update details</strong></summary>
### Front-end Refactoring
- `AIIntegrationSection` split into workspace header, model configuration, Feishu configuration, document panel, and workflow hooks
- `SentimentSection` split into indicator toolbar, historical date bar, independent panel, and data hooks
- `InfoGatheringSection` split into page shell, left sidebar, right detail pane, and workflow hooks
- `ScreenerSection`, `LimitUpLadderSection`, and `StockHoverCard` continue to be split
### Data Source Governance
- The browser no longer directly requests EastMoney
- The front-end uniformly accesses the local Python service's `/eastmoney/*`
- The proxy layer supports request deduplication, caching, failure cooling, concurrency limit, snapshot fallback, minimum request interval, and lightweight retry
### Second Data Source mootdx
Currently supported second source datasets:
- Individual stock `K-line`
- Index `K-line`
- Main index snapshot
- Stock list / basic market data
- Market breadth overview
- Full market raw snapshot
- Full market rise and fall distribution snapshot
- Index sentiment sequence
- Index trading volume sequence
Still retains the main source datasets:
- Daily limit pool / blast pool / limit down pool
- Sector rankings / sector history
- A-share average valuation
- Stock index futures main contract / net position
### Service Layer Reinforcement
Added shared infrastructure:
- `scripts/server/shared/cache.py`
- `scripts/server/shared/db.py`
- `scripts/server/shared/api.py`
Added capabilities:
- Redis / memory dual-mode cache
- HTTP connection pool
- EastMoney dedicated connection pool
- Blocking IO thread pool
- SQLite WAL / busy timeout / automatic transaction control
- Request ID and unified exception response
- Login failure rate limiting, password strength verification, and permission verification
- Feishu sensitive configuration desensitization reading
### GitHub Update Check
GitHub page now supports:
- Automatic check for updates at startup
- Manual check for updates by user clicking the button
- Display of current version, current commit, remote latest commit, and latest release
</details>
## To-Do List
1. `LLM Wiki` knowledge base
2. Automatic early warning for individual stock monitoring conditions
3. Continue improving wave theory and ChiNext painting
4. Hong Kong stock and US stock data access
5. Open data access
## Project Screenshots
















## License Status
- Code license: [`PolyForm Noncommercial 1.0.0`](./LICENSE)
- Prohibited unauthorized commercial use; commercial authorization required, please contact project maintainer for separate permission
- Public repository does not include complete local data, authentication database, third-party report original text, or personal research data
- After cloning, if you need to restore post-market data, please run `npm run sync:*` or Python collection script to generate locally
- Data directory public strategy see: [data/README.md](./data/README.md)
## Function Overview
- Market sentiment cycle, daily limit structure, repair rate, leading stock status, high-risk panel
- Individual stock list, K-line, single-day performance, stock selection pattern recognition
- Sector rotation, theme sustainability, cross-market sentiment indicators
- Local research report list, research report summary, key information aggregation
- `AI daily review`, `pre-market plan`, individual stock observation
- `Skills` rule base, can inject multiple analysis skills into AI review, pre-market plan, individual stock observation, and research report summary
- Individual stock hover card supports main chart `MA` moving average switch and ChiNext structure overlay display ( stroke / line segment / center)
- Local `stdio` MCP Server, for external AI to directly read structured data
- Feishu Q&A robot, can reuse project internal structured data and model lines
## Supported Large Models/Platforms
| Model/Platform | Status | Remarks |
| --- | --- | --- |
| [OpenAI](https://openai.com/) | ✅ | Can access any OpenAI compatible interface format model |
| [Ollama](https://ollama.com/) | ✅ | Local large model running platform |
| [LM Studio](https://lmstudio.ai/) | ✅ | Local large model running platform |
| [AnythingLLM](https://anythingllm.com/) | ✅ | Local knowledge base and document Q&A platform |
| [DeepSeek](https://deepseek.com/) | ✅ | Supports `deepseek-reasoner`, `deepseek-chat` and other lines |
| [SiliconFlow](https://siliconflow.cn/) | ✅ | OpenAI compatible model aggregation platform |
| [VolcEngine](https://www.volcengine.com/product/ark) | ✅ | Supports models such as DouBao |
If you are looking for a hassle-free model aggregation entrance, try [SiliconFlow](https://cloud.siliconflow.cn/i/uVFj3AbT).
- Invitation link: [https://cloud.siliconflow.cn/i/uVFj3AbT](https://cloud.siliconflow.cn/i/uVFj3AbT)
- Invitation code: `uVFj3AbT`
## Quick Start
When only starting the front-end, execute the following two steps:
1. `npm install`
2. `npm run dev`
If you also want to use local data synchronization, Python collection, research report synchronization, or Feishu robot, install Python dependencies and configure environment variables.
Unified startup entrance:
- Start project: `npm run start:project`
- Stop project: `npm run stop:project`
Windows can still use `start_project.bat` / `start_project.ps1`, macOS / Linux use `start_project.sh` / `stop_project.sh`.
If you are a new environment cloned from the GitHub public repository, it is recommended to execute an extra step before the first startup:
`npm run sync:startup-check`
## Local Operation
**Prerequisites:** Node.js, Python 3
1. Install dependencies:
`npm install`
2. If you want to run Python collection chain, research report synchronization, or local stock selection service, install:
`pip install -r requirements.txt`
3. Copy environment variable template, and fill in local configuration as needed:
`Copy-Item .env.example .env.local`
4. Configure environment variables in `.env.local`:
`TUSHARE_API_KEY`
`TUSHARE_API_BASE_URL`
`PYWENCAI_COOKIE`
5. Start development environment:
`npm run dev`
6. Production build:
`npm run build`
## Optional Environment Variables
Common environment variables:
- `TUSHARE_API_KEY`
- `TUSHARE_API_BASE_URL`
- `PYWENCAI_COOKIE`
- `FEISHU_APP_ID`
- `FEISHU_APP_SECRET`
- `FEISHU_BOT_AI_BASE_URL`
- `FEISHU_BOT_AI_API_KEY`
- `FEISHU_BOT_AI_MODEL`
If you only use front-end display and local file reading, these variables can be left unconfigured.
If you want to use `pywencai` one-sentence stock selection, you need to configure `PYWENCAI_COOKIE` in `.env.local`.
Do not submit `.env.local` when publishing the public repository, only submit `.env.example`.
## Data Division
Before adding new interface data functions, see [STRUCTURED_DATA_RULES.md](./STRUCTURED_DATA_RULES.md).
When adding data to the interface, first organize it into a structured object, and then enter the service layer and page. Do not directly use the page splicing result as the data boundary.
Technical division rules:
- `Collection prioritizes Python`
Batch collection, scheduled tasks, historical precipitation, cross-page crawling, and full-market scanning are placed in Python.
- `Display prioritizes front-end`
Page display, upload, preview, filtering, interaction, and browser local storage are placed in front-end `JS/TS`.
- `Node responsible for orchestration`
`npm run sync:*`, startup script, task chaining, and compatible entrance are handled in the Node layer.
- `Exceptions only when obviously better`
Individual capabilities are placed in the front-end or Node when it is more suitable.
Maintain according to the following principles:
- `Python/script offline collection`
Used for daily or post-market precipitation data, such as sentiment cycle, daily limit structure, blast rate, leading stock status, cross-market sentiment indicators, A-share average valuation, and K-line library.
- `Front-end reads local files`
Used for displaying stable snapshot data, such as `data/sentiment.json`, `data/performance.json`, `data/emotion_indicators.json`, research report list, and master holdings snapshot.
- `Front-end real-time request`
Used for lightweight, high real-time requirements, and data that failure does not affect the main process, such as login status, user self-selection, and back-end business API.
Do not recommend putting the following content directly in the front-end crawl:
- EastMoney large disk/full market statistical interface
- Data that needs to leave a history
- Indicators that depend on full market scanning to calculate
Prioritize placing data in the Python collection chain:
- `emotion_indicators.json`
- `stock_list_full.json`
- `stock_list_chinext.json`
- `sector_rotation_*.json`
- `sector_persistence_*.json`
- `limit_up_structure.json`
- `repair_rate.json`
- `leader_state.json`
- `market_volume_trend.json`
- `high_risk.json`
- `cycle_overview.json`
## Data Directory
The project's data directory is being migrated to a market-based structure. The current code supports:
- `New path priority`
- `Old path fallback`
Directory structure example:
```text
data/
markets/
a_share/
klines/
single_day_snapshots/
sentiment.json
performance.json
stock_list_full.json
stock_list_chinext.json
limit_up_structure.json
repair_rate.json
leader_state.json
market_volume_trend.json
high_risk.json
cycle_overview.json
emotion_indicators.json
index_futures_long_short.json
bull_bear_signal.json
hk/
us/
research_reports/
a_share/
manifest.json
hk/
us/
system/
sync_status.json
auth.db
```
Compatibility rules:
- Front-end and scripts first read `data/markets/a_share`, `data/research_reports/a_share`, and `data/system`
- If no file exists in the new path, it will automatically fall back to the old `data/*.json` and `data/research_reports/*`
- So you can migrate code first and then move files gradually, without needing to switch at once
Continue to retain content that the front-end directly obtains or interface fallback:
- Login status, self-selection, back-end business interface
- Temporary real-time query required only during page interaction
- Read-only fallback request when local offline file is missing
## Service Layering
- `services/quotesService.ts`
Individual stock list, K-line, single-day rise and fall, stock selection pattern recognition
- `services/chanService.ts`
ChiNext structure calculation, responsible for containing processing, fractal, stroke, line segment, and center
- `services/sectorService.ts`
Sector rotation, sector sustainability
- `services/sentimentCycleService.ts`
Sentiment cycle read entrance
- `services/emotionIndicatorService.ts`
Cross-market sentiment indicators
- `services/localDataService.ts`
Local `data/*.json` read
- `services/dataPathService.ts`
Local data path compatibility layer, handling new and old directory fallback
- `services/eastmoneyService.ts`
EastMoney request and proxy fallback
## Data Synchronization
- Full synchronization: `npm run sync:all`
- Post-market main data synchronization: `npm run fetch:data`
- Python main data synchronization: `npm run sync:market:py`
- Python K-line library synchronization: `npm run sync:kline:py`
- Sentiment cycle snapshot synchronization: `npm run sync:cycle`
- Python sentiment cycle snapshot synchronization: `npm run sync:cycle:py`
- Stock snapshot synchronization: `npm run sync:stocks`
- Sector snapshot synchronization: `npm run sync:sectors`
- Python stock snapshot synchronization: `npm run sync:stocks:py`
- Python sector snapshot synchronization: `npm run sync:sectors:py`
- Python offline snapshot synchronization: `npm run sync:offline:py`
- Cross-market sentiment indicator synchronization: `npm run sync:emotion`
- Automatic post-market synchronization: `npm run fetch:data:auto`
- Pre-startup data check: `npm run sync:startup-check`
- Single-day project snapshot export: Double-click `获取单天数据.bat`, export by date to `data/single_day_snapshots/YYYY-MM-DD.json`
- Historical data completion: Double-click `补全之前数据.bat`, can be selected by `主市场 / 股票 / 板块 / 周期 / 情绪 / K线`; sectors also support `概念 / 行业 / 全部`
When double-clicking `start_project.bat` or executing `start_project.ps1`, it will perform a pre-startup data check.
If the local data is the latest trading day, it will skip directly; if you need to skip this step, you can temporarily set:
- `STARTUP_AUTO_SYNC=0`
- `STARTUP_SYNC_MODE=startup` default lightweight mode, only check `market-core + emotion + sectors + cycle`
- `STARTUP_SYNC_MODE=market` run complete main market chain
- `STARTUP_SYNC_MODE=offline` run complete offline synchronization
`fetch:data` will update:
- `sentiment.json`
- `performance.json`
- `ladder.json`
- `stock_list_full.json`
- `stock_list_chinext.json`
- `sector_rotation_*.json`
- `sector_persistence_*.json`
- `limit_up_structure.json`
- `repair_rate.json`
- `leader_state.json`
- `market_volume_trend.json`
- `high_risk.json`
- `cycle_overview.json`
Collection entrance description:
- `fetch:data`
Main orchestration entrance. Synchronize the latest main data, stock snapshots, sector snapshots, and sentiment cycle snapshots first, without running heavy K-line libraries.
If you need to include K-line libraries in this link, you can temporarily set: `FULL_SYNC_INCLUDE_KLINE=1`
- `sync:offline:py`
Pure Python offline snapshot entrance, used for complete supplementary main data, stocks, sectors, K-line libraries, sentiment indicators, and sentiment cycle snapshots.
- `sync:stocks` / `sync:sectors` / `sync:cycle`
Unified Python collection entrance; old JS files only retain compatible forwarding.
- `sync:reports`
Go to Python collection: capture a list of single research reports from East Fortune, summary of details page, and PDF links, and retain an overview page of East Fortune and a snapshot of Tianfeng Securities page. Existing single research reports will be reused incrementally according to `infoCode`, without repeating details.
Optional environment variables:
`REPORT_SOURCE_KEYS=eastmoney-stock-report,eastmoney-industry-report`
`REPORT_INCLUDE_SNAPSHOTS=0`
`REPORT_ITEM_LIMIT_OVERRIDE=10`
`REPORT_DOWNLOAD_PDFS=0`
Synchronization strategy:
- Main orchestration and offline total entrance with phased logs and failure retries.
- Each phase defaults to retry `2` times, can be overridden by `SYNC_STAGE_RETRIES`.
- Phase retry interval defaults to `1500ms`, can be overridden by `SYNC_RETRY_DELAY_MS`.
- `K-line library` defaults to run `1` time, avoid large batch tasks in case of failure to repeat pulling full data.
- Can use `SYNC_STAGES=market-core,stocks,sectors,kline,cycle,emotion,market-pipeline` to run only specified phases.
- Orchestration layer will check local snapshots for the latest trading day; if it is the latest, it will skip the corresponding phase directly.
- `K-line library` will pre-screen locally by symbol; codes that have been updated to the latest trading day will not be requested repeatedly.
- `K-line library` defaults to supplement only a recent rolling window of data and merge into local history; earlier gaps will not be actively supplemented in daily synchronization.
- Can use `KLINE_RECENT_LIMIT=30` to adjust the default rolling window size.
- If you need to force a full refresh of K-lines, you can temporarily set `KLINE_FORCE_FULL=1`.
- `sync:all` allows single-phase failure to continue subsequent phases by default, can be changed back to failure immediately by `SYNC_CONTINUE_ON_ERROR=0`.
- Main orchestration, offline synchronization, and automatic post-market tasks will output phase summaries, including completion, skipping, and failure statistics.
- `fetch:data`, `sync:offline:py`, `sync:all`, and `fetch:data:auto` will write to `data/sync_status.json`, saving the latest synchronization trading day, phase status, time-consuming, and local snapshot date.
- `sync:emotion` adds fault tolerance:
- A-share average valuation is changed to batch grabbing + tail average
- There will be a short pause between requests to reduce interface jitter
- When the full market pagination fails in the middle, if there is already valid data, it will retain the data obtained to continue generating
## To-Do
- Continue to enrich the summary content of `data/sync_status.json`, supplement more failure reasons, skipping reasons, and phase-level diagnostic information.
- Python collection adds more fine-grained failure details, distinguishing interface request failure, local write failure, and data parsing failure.
- `AI docking > stock observation` adds historical timeline:
- Precipitate AI observation results of different trading days by stock dimension
- Show the judgment changes of the same stock in the process of startup, acceleration, differentiation, repair, and decline
- As an auxiliary view to review stock evolution and AI judgment stability
- Plan `QuantDash + Feishu` integration:
- Automatically push `AI daily review` to Feishu group after market close
- Automatically push `pre-market plan` to Feishu before market open
- Research report grabbing results are synchronized to Feishu table / multidimensional table
- Large V review is sorted out and synchronized to Feishu document
- Data synchronization failure sends Feishu alarm
- Still executed according to existing project rules: `collection prioritizes Python`, and Feishu push is completed by Python / Node orchestration layer, and the front end does not undertake main push logic
## MCP Access
The project has built-in local `stdio` MCP Server for external AI to directly read structured data of the market, without parsing the front-end page.
1. Start MCP Server:
`npm run mcp:server`
2. Available tools:
`get_market_dashboard`
`get_leader_state`
`get_sector_persistence`
`get_cycle_overview`
`get_volume_trend`
`get_high_risk_panel`
`get_sentiment_snapshot`
`get_news_feed`
`get_research_reports`
`get_research_report_content`
`get_expert_holding_snapshots`
`get_expert_holding_snapshot`
3. MCP Server entrance file:
[scripts/mcp-server.js](scripts/mcp-server.js)
For more complete tool descriptions, see [AI_MCP_GUIDE.md](./AI_MCP_GUIDE.md).
Usage:
AI reads structured data through MCP, and then performs sentiment cycle, leader state, theme sustainability, and news impact analysis, without parsing page DOM.
## Feishu Q&A Robot
The project provides an additional Feishu Q&A service that can connect `sentiment cycle` data to Feishu robot.
Feishu access code is placed separately in `scripts/integrations/feishu/`.
Feishu uses `long connection / WebSocket` event subscription mode, without the need for a public network callback address.
1. Configure in `.env.local`:
`FEISHU_APP_ID`
`FEISHU_APP_SECRET`
`FEISHU_BOT_AI_BASE_URL`
`FEISHU_BOT_AI_API_KEY`
`FEISHU_BOT_AI_MODEL`
2. Start service:
`npm run feishu:bot`
3. Switch the event subscription method to:
`Use long connection to receive events`
4. Keep the process running locally, without the need for a public network IP, domain name, or intranet penetration
Implemented:
- Support Feishu `text` message long connection reception
- Support extracting dates in messages, such as `Analyze 2026-03-27 sentiment cycle`
- Read local `get_sentiment_snapshot` same caliber data
- Call configured `OpenAI compatible model`
- If the model is not configured or the call fails, it will fall back to local rule summary
Usage scenarios:
- Ask about sentiment cycle on a certain day
- Ask about market judgment on the latest trading day
- Let AI comprehensively refer to `smashing coefficient / daily limit premium / blasting rate / repair rate / leader state / volume / high position risk`
## AI Docking
There is an `AI docking` page on the left. This page makes model docking configuration and also undertakes `AI daily review`, `pre-market plan`, and research report summary calls.
- Maintain each model line on the page:
`ChatGPT / OpenAI`
`Dou Po / Huoshan Fangzhou`
`Gemini`
`DeepSeek`
`Zhipu`
`OpenRouter`
`Ollama`
`LM Studio`
`Custom OpenAI compatibility`
- Common model lines include:
`Dou Po`
`ChatGPT`
`Gemini`
`DeepSeek`
`GLM`
Default presets are covered.
- Fill in:
`token / api key`
`base url`
`model`
`Remarks`
- The page supports basic `connectivity test`:
`OpenAI compatible interface` first detects `/models`
`Gemini` detects `models` list
`Anthropic` detects `v1/models`
- Local models are uniformly exposed as `OpenAI Compatible API`, so the same set of configurations can be compatible with Ollama, LM Studio, vLLM, and self-built gateways.
- The page will generate a copyable `mcpServers` configuration fragment, which facilitates docking with MCP-supported clients such as Claude Desktop, Cherry Studio, and Open WebUI.
Instructions:
- `Model calling` uses your configured cloud or local model
- `Structured data reading` uses the built-in `MCP Server` of this project
- Do not let the model directly parse the front-end page DOM
- `Information collection > research report` supports directly calling the enabled model to generate `AI summary`, and the summary result is cached to the browser locally by `research report + model`.
- The `AI docking` page supports generating `AI daily review`, and the analysis object is the `latest trading day`, not the natural day "today".
- The `AI docking` page supports generating `pre-market plan`, based on the latest trading day review output next trading day observation list, trading plan, and risk reminder.
- `AI daily review` and `pre-market plan` support:
`One-click copy`
`Download PDF` (save as PDF through the browser print window)
- `Pre-market plan` will automatically extract observation target codes and support one-click addition:
Write to the backend favorite if logged in
Fall back to the local key concern list if not logged in
## Skills
The left `Skills` page is located between `AI docking` and `GitHub`.
This page is not a GitHub skills market but a project-internal AI analysis rule library. You can create multiple skills and set for each skill:
- Name
- One-sentence description
- Direct injection model rules and instructions
- Automatic effective range
Automatic injection range:
- `AI daily review`
- `Ultra-short depth analysis`
- `Pre-market plan`
- `Stock observation`
- `Next-day verification`
- `Research report summary`
Suitable for writing into Skills:
- Fixed output structure
- Risk preference
- Review caliber
- Prohibited items
- Leader / sentiment / theme priority
Do not write dead data in skills. Skills are used to constrain the analysis method of the model, not to replace input data.
## Stock Chart and缠论
The hover chart in `Stock Information` supports:
- Main chart K-line
- `MA` moving average main chart overlay switch
- `BOLL` main chart overlay
- `MACD / KDJ / RSI / BIAS / WR / VR` sub-chart switching
-缠论 structure switch
The current缠论 structure is the first version of visualization capability, including:
- Include relationship processing
- Subdivision
- Stroke
- Line segment
- Zhong轴
Supplement:
- Zhong轴 adopts `stroke-level Zhong轴 priority, line segment-level Zhong轴 bottoming`
- Currently, it has not accessed `backtracking`, `1-2-3 buy and sell points`, and `multi-cycle linkage`
- Mainly used for graphical auxiliary judgment, not a strict trading signal engine
## License Description
- The code of this repository is provided under the [`PolyForm Noncommercial 1.0.0`](./LICENSE) license.
- Without additional authorization from the project maintainer, the code of this repository cannot be used for commercial purposes.
- The repository does not contain `.env.local`, local database, third-party report original text, web page snapshot, and personal research data.
- Please confirm the applicable scope of code license and data source license before use, deployment, or redistribution.
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
Vibe-Trading
Vibe-Trading: Your Personal Trading Agent
ai-berkshire
Berkshire in the AI Era: A Value Investment Research Framework Based on...
valuecell
Valuecell is a Python project for efficient data management.
ai-polymarket-agent
Enable Claude, ChatGPT, and other AI agents to analyze markets, fetch...
revit-mcp-plugin
A Revit plugin based on MCP protocol that enables AI to interact with Revit...
SharpToolsMCP
SharpToolsMCP is an AI-powered service for analyzing and modifying C# code...