Task Objective
- This Skill is used for: conducting comprehensive technical analysis on a specified stock, including real-time data acquisition, technical indicator calculation, support and resistance level analysis, and gap identification and analysis.
- Capabilities include: real-time quote acquisition, technical indicator calculation (moving averages, MACD, RSI), support and resistance level identification, gap identification (upward/downward gaps and their support/resistance effects), trend judgment, and future trend prediction.
- Trigger conditions: the user provides a stock code and requests trend analysis, future prediction, or trading recommendations.
Prerequisites
- Dependency description:
requests>=2.28.0 numpy>=1.24.0 pandas>=2.0.0
Operation Steps
Standard Process
-
Obtain and verify the stock code
- The user provides a stock code, such as: 000001 (Ping An Bank), sh600000 (Shanghai Pudong Development Bank), 000001.SZ (Shenzhen Stock Exchange format)
- Refer to the stock code format documentation to ensure the code format is correct
-
Obtain real-time quote data
- Call
scripts/fetch_stock_data.pyto obtain real-time quotes and historical K-line data - Parameters:
--stock_code: stock code--days: number of days of historical data to obtain (default 30 days)
- Returns include: current price, price change percentage, trading volume, and historical K-line data
- Call
-
Calculate technical indicators and support levels
- Call
scripts/analyze_stock.pyfor technical analysis - Parameters:
--data_file: the data file path obtained in the previous step
- Calculation results:
- MA5/MA10/MA20/MA60 moving averages
- MACD indicator
- RSI indicator
- Support and resistance levels
- Gap analysis(upward gaps and downward gaps)
- Trading volume analysis
- Trend judgment
- Call
-
Analyze the current trend
- Conduct multi-dimensional analysis based on technical indicators:
- Moving average alignment (bullish alignment/bearish alignment/tangled)
- MACD golden cross and death cross status
- RSI overbought and oversold status
- Trading volume coordination
- K-line pattern analysis
- Gap analysis:
- Upward gap: usually forms a support level (during a pullback, the upper edge of the gap may become support)
- Downward gap: usually forms a resistance level (during a rebound, the lower edge of the gap may become resistance)
- The impact of gap size and position on the trend
- Conduct multi-dimensional analysis based on technical indicators:
-
Predict the trend for the next 3 days
- Based on comprehensive technical indicators and trend analysis, judge the trend for the next 3 days
- Factors to consider: trend direction, support and resistance levels,gap support and resistance, trading volume changes, market sentiment
- Provide probability assessments: the probability and strength of rise/fall/sideways movement
-
Generate trading recommendations
- Based on the analysis results and predictions, provide clear operational recommendations:
- Buy/Hold/Sell/Wait and see
- Recommended buy/sell price range
- Stop-loss and take-profit level settings
- Operation tips related to gaps(e.g., an upward gap can serve as a support reference before it is filled)
- Risk warnings and precautions
- Based on the analysis results and predictions, provide clear operational recommendations:
Resource Index
- Get data: see scripts/fetch_stock_data.py(Purpose: obtain real-time stock quotes and historical K-line data)
- Technical analysis: see scripts/analyze_stock.py(Purpose: calculate technical indicators and support/resistance levels)
- Code format: see references/stock_code_format.md(Purpose: reference for stock code format)
Precautions
- The stock market involves risks. All analyses are for reference only and do not constitute investment advice
- Technical analysis is based on historical data and cannot guarantee future performance
- It is recommended to make a comprehensive judgment in combination with fundamental analysis and the market environment
- Real-time data may be delayed; please refer to actual trading data
- Key points of gap analysis:
- Upward gap (gap up at the open): usually may form support during a pullback; pay attention to whether the gap is filled
- Downward gap (gap down at the open): usually may form pressure during a rebound; pay attention to whether the gap is filled
- The larger the gap, the stronger its support or pressure effect usually is
- Gaps accompanied by trading volume are more meaningful for reference
- Recent gaps have higher reference value than distant gaps
- Risk warnings must be included in all recommendations
Usage Examples
Example 1: A-share stock analysis
用户:分析000001平安银行
执行:
1. 调用 fetch_stock_data.py --stock_code 000001 --days 30
2. 调用 analyze_stock.py --data_file stock_data_000001.json
3. 基于分析结果生成走势预测和操作建议
Example 2: Hong Kong stock analysis
用户:分析腾讯控股 00700.HK
执行:
1. 调用 fetch_stock_data.py --stock_code 00700.HK --days 30
2. 调用 analyze_stock.py --data_file stock_data_00700.HK.json
3. 生成分析报告和操作建议
Example 3: U.S. stock analysis
用户:分析AAPL苹果公司
执行:
1. 调用 fetch_stock_data.py --stock_code AAPL --days 30
2. 调用 analyze_stock.py --data_file stock_data_AAPL.json
3. 提供全面的技术分析报告