SuperAPI AI Directory

stock-advisor

Data & analytics

View repository

Updated 10-15 22:38

About this skill

A-share Investment Advisor (Stock Advisor)

A fully automated orchestrated investment analysis pipeline. The user only needs to provide a stock screenshot or code, and the system automatically completes technical analysis, fundamental analysis, multi-dimensional cross-validation, and private board decision-making discussion, ultimately outputting a beautifully formatted investment report.

Pipeline Architecture

用户输入(截图 / 股票代码)
        │
        ▼
  ① 技术面分析 → ② 基本面分析 → ③ 多维交叉验证 → ④ 私董会讨论 → ⑤ 排版输出

Startup Process

First Use: Investment Style Profile

Check whether a user investment style profile exists in memory. If it does not exist, ask 3-4 brief questions:

  1. Risk preference: Conservative / Balanced / Aggressive?
  2. Investment horizon: Short term (1-2 weeks) / Medium term (1-3 months) / Long term (more than 3 months)?
  3. Industries of interest: Are there any industry sectors you particularly follow?
  4. Position limit: Maximum position proportion for a single stock?

The user may choose to skip, and the information can be naturally supplemented later during the private board session. The collected information is saved to memory.

Identify Entry Mode

Automatically determine based on user input:

  • Screenshot mode: The user uploaded an image (candlestick chart, financial report screenshot) → image recognition + AKShare cross-validation
  • Code mode: The user provided a stock code or name → purely AKShare data-driven

Both modes enter the same pipeline; the only difference is the data acquisition method.


Module One: Technical Analysis

Screenshot Mode

  1. Image recognition: Extract from the candlestick chart:

    • Stock name and code
    • Current stock price
    • Candlestick pattern (performance over the last 5 days)
    • Moving average alignment status (MA5/MA10/MA20)
    • MACD status (DIF/DEA positional relationship, histogram trend)
  2. AKShare cross-validation: Use the recognized stock code to call the script and obtain precise data

    python scripts/technical_analysis.py --symbol <股票代码> --days 120
    
  3. Conflict handling: If there is a discrepancy between image recognition and API data, API data shall prevail, and the discrepancy shall be noted in the report

Code Mode

Directly call the script to obtain data and calculate indicators:

python scripts/technical_analysis.py --symbol <股票代码> --days 120

Output: Technical quick-read table

Dimension Indicator Value Signal
Trend MA20/MA60 — Rising/Consolidating/Falling
MACD DIF/DEA — Golden cross/Death cross/Bullish/Bearish
KDJ K/D/J — Overbought/Oversold/Neutral
RSI RSI14 — Overbought/Oversold/Neutral
Bollinger Bands Upper band/Middle band/Lower band — Breakout/Bullish bias/Bearish bias
Support and resistance Support level/Resistance level — —

Module Two: Fundamental Analysis

Screenshot Mode

  1. Image recognition: Extract key indicators from the financial report screenshot (revenue, net profit, ROE, gross margin, etc.)
  2. AKShare supplement: Fetch PE/PB/PS valuation data, industry comparison data
    python scripts/fundamental_analysis.py --symbol <股票代码>
    

Code Mode

Call the script directly:

python scripts/fundamental_analysis.py --symbol <股票代码>

Merged Output

Comprehensive Rating Table:

Dimension Score Judgment
Technical X/5 Trend direction + key signals
Fundamental X/5 Profitability + valuation level
Capital Flow X/5 Trading volume change trend
Comprehensive Rating — Strong Buy/Buy/Neutral/Cautious/Avoid

Action Recommendations:

  • Short-term (1-2 weeks) strategy
  • Medium-term (1-3 months) strategy
  • Key support and resistance levels

Module 3: Multi-dimensional Cross-validation

Use the built-in WebSearch tool to search for the following information:

  1. Research Report Views: Search "<股票名称> 研报 <当前年份>" to obtain institutional ratings and target prices
  2. Industry Trends: Search "<所属行业> 行业趋势 <当前年份>" to understand upstream and downstream changes
  3. Major News: Search "<股票名称> 最新消息" to identify major positive/negative events
  4. Policy Impact: Search for relevant industrial policies and regulatory developments

Cross-validation Logic

  • Compare the search results with the analysis from Modules 1 and 2
  • If there are contradictory signals (e.g., technically bullish but research reports bearish),clearly mark the points of divergenceand analyze possible reasons
  • Supplement risk factors not covered by Modules 1 and 2

Output: Draft Investment Decision Report

Integrate the analysis results of the first three modules to generate a structured draft investment decision report as input for the private board discussion.


Module 4: Private Board Decision Discussion

Call the core mechanism of the peers-advisory-group Skill, using the draft investment decision report as the discussion topic.

See references/advisory-board.mdfor the detailed guide, including the advisor lineup, 5-dimension analysis structure, viewpoint collision template, and investment style adaptation rules.

Core Process

  1. Use WebSearch to search for the latest updates of the four advisors (Buffett/Musk/Gates/Jobs)
  2. Use the complete report from Modules 1-3 as the discussion topic
  3. Each advisor outputs an in-depth analysis following the 5-dimension structure : core judgment → data evidence → analogous cases → risk warnings → one-sentence final recommendation
  4. Output 2-3 viewpoint collisions(divergences and debates among different investment philosophies)
  5. Generate personalized recommendations
  6. Synthesize the views of the four advisors and output the final investment conclusion

Automated Mode

By default, the system answers the advisors' questions on behalf of the user (based on analysis data + user style profile). If the user speaks proactively, the system pauses automatic answering and hands the conversation over to the user.


Module 5: Layout and Output

Step 1: Organize the Report Markdown

Organize the final analysis results into the following structure:

# [股票名称]([代码]) 投资分析报告

> 报告日期:YYYY-MM-DD | 综合评级:XX

## 技术面分析
[模块一输出]

## 基本面分析
[模块二输出]

## 多维交叉验证
[模块三输出]

## 私董会纪要
### 巴菲特观点
[观点摘要]
### 马斯克观点
[观点摘要]
### 比尔·盖茨观点
[观点摘要]
### 乔布斯观点
[观点摘要]
### 最终结论
[综合结论]

## 操作建议
- 短期策略(1-2周)
- 中期策略(1-3月)
- 仓位建议
- 止损位

## 风险提示
投资有风险,以上分析仅供参考,不构成投资建议。据此操作,风险自担。

Step 2: Magazine Layout

Call the magazine-layout Skill, specifying "Bold Editorial" style, convert Markdown to a beautifully formatted HTML file.

Save HTML locally:~/stock-reports/<股票代码>-<日期>.html

Step 3: Convert to PDF

Run the conversion script:

python scripts/html_to_pdf.py ~/stock-reports/<股票代码>-<日期>.html

Output PDF file:~/stock-reports/<股票代码>-<日期>.pdf

Step 4: Upload to Feishu Cloud Docs

Call the lark-doc Skill to create the report content as a Feishu cloud document:

  • Document title:[股票名称] 投资分析报告 - YYYY-MM-DD
  • Return the document link to the user

Final output to the user

分析完成!

本地 PDF:~/stock-reports/<代码>-<日期>.pdf
飞书文档:<飞书链接>

综合评级:XX
核心结论:[一句话总结]

Dependencies

Component Purpose
AKShare (Python) A-share market quotes, K-line, and financial data retrieval
a-share-analyst scripts Technical analysis, data retrieval foundational scripts
WebSearch (built-in) Research reports, industry, and news search
peers-advisory-group Skill Private board decision discussion
magazine-layout Skill Magazine-style HTML layout
lark-doc Skill Feishu cloud document upload
Playwright (Python) HTML to PDF

Script list

Script Function
scripts/technical_analysis.py Technical indicator calculation (reuses a-share-analyst)
scripts/fetch_market_data.py Market data retrieval (reuses a-share-analyst)
scripts/fundamental_analysis.py Fundamental analysis (new)
scripts/html_to_pdf.py HTML to PDF (new)

Reference files

File Content
references/report-structure.md Report structure template
references/image-prompts.md Image recognition prompt template