SuperAPI AI Directory

investment-analysis

General & other

View repository

Updated 10-16 09:30

About this skill

Investment Analysis

This skill is used to analyze Chinese and global financial markets, using local price data and financial news for analysis.

When performing investment analysis,must follow the order belowand operate step by step:

Analysis Process

Step 1: Update Data

The data is updated daily, thereforethe data update script must be run first:

scripts/update-data.sh

wait for the script to finish executing and ensure all CSV files have been downloaded to the assets/data/ directory.

After the data is updated, the date of the latest data must be checked immediately:

scripts/check-data.sh

The script will display the latest date of all data files and report it to the user.

If the script fails to execute or network issues cause an incomplete download, the situation must be explained to the user, and ask whether to continue using the existing data for analysis.

Step 2: Load Data

All data is located in the assets/data/ directory; use the Read tool to read the relevant CSV files.

Stock Indices (daily OHLC)

File Index Fields
stock_index_sse_composite.csv Shanghai Composite Index date, code, name, open, close, high, low, amplitude
stock_index_csi300.csv CSI 300 Same as above
stock_index_chinext.csv ChiNext Index Same as above
stock_index_hsi.csv Hang Seng Index Same as above
stock_index_sp500.csv S&P 500 Same as above
stock_index_nasdaq.csv Nasdaq Same as above

amplitude, i.e. amplitude = (highest price - lowest price) / previous day's closing price × 100%, is an important indicator for measuring market volatility and sentiment.

Precious Metals (daily)

File Variety Fields
precious_metal_gold.csv Shanghai Gold date, evening_price, morning_price
precious_metal_silver.csv Shanghai Silver date, evening_price, morning_price

Shanghai Gold unit: yuan/gram; Shanghai Silver unit: yuan/kilogram.

Financial News

File Fields
news_breakfast.csv date, summary, source_url, source

Daily financial breakfast summary from East Money, processed by AI.

When reading data, note:

  • For recent analysis, read the last 200 lines of each file; for long-term trend analysis, read appropriately more.
  • You can also use the Grep tool with dates to read CSV files and quickly locate the required data rows.
  • Always check the latest date in each file; if the data has not been updated to today, the data lag must be explained to the user.

Step 3: Technical Analysis

Analyze based on OHLC data:

  • Trend direction: Compare the recent 5/10/20/60 trading days; is the market rising, falling, or moving sideways?
  • Moving average system: Calculate and compare MA5, MA10, and MA20. Determine bullish/bearish alignment and identify golden cross/death cross signals.
  • Support and resistance: Identify recent highs and lows, key round-number levels, and dynamic support and resistance at moving averages.
  • Amplitude/Volatility: Observe the amplitude field. Volatility expansion usually means a trend is starting or accelerating, while narrowing may indicate an impending turning point.
  • Price Position: Where is the current price within the recent range? Is it near the recent high (resistance zone) or low (support zone)?
  • Volume-Price Coordination Hypothesis: Since the data only contains OHLC, use the ratio of amplitude to price change to observe whether there is logical inference of "high volume with stagnant price" or "low volume with hollow decline" (large amplitude with small price change usually suggests strong disagreement).

Step 4: News Analysis

Read assets/data/news_breakfast.csv entries from the past 7–14 days and conduct a comprehensive analysis, for example identifying:

  • Major Policy Changes: fiscal stimulus, monetary easing/tightening
  • Macroeconomic Data: GDP, CPI, PMI, etc.
  • Regulatory Actions: IPO suspensions, capital market rule adjustments
  • International Trade / Geopolitical Events: tariffs, sanctions, summits
  • Industry Developments: regulatory crackdowns, industry support
  • Corporate Earnings: profit warnings, earnings beats
  • Market Sentiment: investor confidence indices, capital flows
  • Other Unexpected Events: natural disasters, public health events

For each key news item, determine: which markets is it bullish/bearish/neutral for?

Step 5: Cross-Market Linkages

Analyze resonance and divergence across different markets, and identify macro capital flows, for example:

  • US Stocks → A-Shares Transmission: S&P 500/Nasdaq trends usually lead A-share (SSE Composite/CSI 300/ChiNext) sentiment by about 1 trading day.
  • Hong Kong Stocks as a Bridge: The Hang Seng Index simultaneously reflects overnight US stock trends and China's fundamentals. Because of its relatively high foreign ownership, it is a leading indicator of international capital's willingness to allocate to Chinese assets.
  • Gold vs Stocks: Gold rising while stocks fall usually represents rising risk aversion; if gold and stocks rise together, it may suggest rising inflation expectations.
  • Gold-Silver Ratio Analysis: Silver has strong industrial attributes. Silver outperforming gold (a falling gold-silver ratio) usually signals economic recovery or expanding industrial demand; the opposite suggests downward economic pressure.
  • Large Cap vs Small Cap (Broad-Based Spread): Compare the CSI 300 and ChiNext. The CSI 300 leading gains reflects value return or blue-chip support, while active small-cap stocks represent improved market risk appetite (good money-making effect).
  • Linkage Failure Signal: If US stocks surge but A-shares open lower and trend lower the next day, it usually signals extremely weak domestic fundamentals or sentiment.

Step 6: Forward-Looking Assessment

Analyze based on historical patterns:

  • Historical Scenario Comparison: How has the market historically responded to similar event types? Compare the valuation level and sentiment environment of the current and historical cycles.
  • Seasonal Patterns: Spring Festival rally ("calendar effect"), "sell in May and go away, buy again in July", year-end window period, quarterly rebalancing, earnings season effects.
  • Policy Cycle and Turning Points: At what stage of the monetary/fiscal cycle are we currently? Identify the sequence of the "policy bottom", "sentiment bottom", and "market bottom".
  • Extreme Indicator Repair: Observe whether the short-term decline is overextended (such as the technical rebound demand after consecutive days of large-amplitude sharp drops) or whether the increase has deviated too far from the moving average due to overheating.

Express uncertainty clearly, for example: "Historically X tends toward Y, but the current context Z may cause the mean-reversion logic to differ."

Step 7: Output

  • Conversational analysis: Directly answer the user's specific question, citing specific dates, prices, and percentage changes from the data, and do not pile up irrelevant content.
  • Report generation: Ask the user whether they need to save the analysis report. If the user agrees, write the Markdown report to ./reports/YYYY-MM-DD.md, with the format referring to the template below.

Report template

# 投资分析报告 — YYYY-MM-DD

## 市场概览

(各市场最近交易日的表现。用表格呈现:市场名称 | 收盘价 | 涨跌幅 | 振幅)

## 技术面分析

(参考前面步骤提到的具体分析维度。)

## 消息面解读

(参考前面步骤提到的具体分析维度。每条新闻标注日期,评估影响:利多/利空/中性。)

## 跨市场联动

(参考前面步骤提到的具体分析维度。)

## 未来展望

(基于分析的前瞻研判。标注潜在的市场走向和风险因素。)

## 风险提示

(当前需关注的关键风险因素。)

---
*分析仅供参考,不构成投资建议。*

Important rules

  • Always cite specific dates and numbers from the data; fabricating data is strictly prohibited
  • When trends are uncertain, state this clearly; do not force random fluctuations into a narrative
  • All output must include a disclaimer: the analysis is for reference only and does not constitute investment advice
  • The data may not be updated to today, so always check the latest date in the CSV and inform the user of the data lag