a-stock-daily-report

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

A股日报自动生成系统

A-share Daily Report Automatic Generation System

自动抓取 A 股市场数据,生成日报。
Automatically crawls A-share market data and generates daily reports.

功能

Features

  • 📊 大盘概览:上证、深证、创业板、科创板指数
  • 🔥 热门板块:涨幅 TOP 5 板块
  • 📈 明日关注:技术面突破、政策利好板块
  • ⚠️ 风险提示:高估值、资金流出板块
  • 💰 资金动向:北向资金、主力净流入
  • 📊 Market Overview: Shanghai Composite Index, Shenzhen Component Index, ChiNext Index, STAR Market Index
  • 🔥 Popular Sectors: Top 5 sectors by growth rate
  • 📈 Watchlist for Tomorrow: Sectors with technical breakthroughs and policy benefits
  • ⚠️ Risk Warning: Sectors with high valuation and capital outflow
  • 💰 Capital Trends: Northbound capital, main force net inflow

快速开始

Quick Start

生成日报

Generate Daily Report

bash
node scripts/a-stock-report.js
直接运行即可生成 A股日报报告。
bash
node scripts/a-stock-report.js
Run directly to generate the A-share daily report.

保存到文件(可选)

Save to File (Optional)

bash
undefined
bash
undefined

Linux/Mac

Linux/Mac

mkdir -p ~/documents/reports/a-stock-daily-report node scripts/a-stock-report.js > ~/documents/reports/a-stock-daily-report/report_$(date +%Y%m%d).md
mkdir -p ~/documents/reports/a-stock-daily-report node scripts/a-stock-report.js > ~/documents/reports/a-stock-daily-report/report_$(date +%Y%m%d).md

Windows

Windows

if not exist %USERPROFILE%\documents\reports\a-stock-daily-report mkdir %USERPROFILE%\documents\reports\a-stock-daily-report node scripts/a-stock-report.js > %USERPROFILE%\documents\reports\a-stock-daily-report\report_%date:~0,4%%date:~5,2%%date:~8,2%.md
undefined
if not exist %USERPROFILE%\documents\reports\a-stock-daily-report mkdir %USERPROFILE%\documents\reports\a-stock-daily-report node scripts/a-stock-report.js > %USERPROFILE%\documents\reports\a-stock-daily-report\report_%date:~0,4%%date:~5,2%%date:~8,2%.md
undefined

数据来源

Data Sources

  • 东方财富网:板块排行、指数行情
  • API:免费,无需密钥
  • East Money: Sector rankings, index quotes
  • API: Free, no API key required

⚠️ 重要提示

⚠️ Important Notes

数据获取失败处理

Data Acquisition Failure Handling

当部分数据获取失败时(如指数或板块数据),报告会继续生成并在报告中标注失败原因,对应数据显示为
--
When partial data acquisition fails (such as index or sector data), the report will continue to be generated with the failure reason marked in the report, and the corresponding data will be displayed as
--
.

API 使用限制

API Usage Restrictions

  • 指数数据 API 在非交易时间(晚间、周末)可能关闭
  • 建议运行时间:交易日收盘后 15:30-16:00(A股15:00收盘)
  • 如需在晚间获取数据,建议:
    1. 缓存机制:在收盘后 30 分钟内运行一次并缓存数据
    2. 手动维护:使用本地存储的指数数据
    3. 降级处理:指数数据不可用时仍可生成板块数据报告
  • Index data API may be closed during non-trading hours (evenings, weekends)
  • Recommended running time: 15:30-16:00 after the close of trading days (A-share closes at 15:00)
  • If you need to obtain data in the evening, it is recommended to:
    1. Caching mechanism: Run once within 30 minutes after the market closes and cache the data
    2. Manual maintenance: Use locally stored index data
    3. Degradation processing: Sector data reports can still be generated when index data is unavailable

环境变量

Environment Variables

无需配置环境变量。
No environment variable configuration required.

依赖项

Dependencies

  • Node.js 14+
  • 无需额外依赖包(使用 Node.js 内置模块)
  • Node.js 14+
  • No additional dependency packages required (uses Node.js built-in modules)

故障排除

Troubleshooting

运行失败或数据异常

Operation Failure or Data Abnormality

  1. 确认 Node.js 版本 >= 14:
    node --version
  2. 检查网络连接
  3. 查看错误日志(stderr 输出)
  4. 确认 API 是否可用(非交易时间、周末/节假日可能关闭)
  5. 检查是否为交易日并确认运行时间合适
  1. Confirm Node.js version >= 14:
    node --version
  2. Check network connection
  3. View error log (stderr output)
  4. Confirm whether the API is available (may be closed during non-trading hours, weekends/holidays)
  5. Confirm it is a trading day and the running time is appropriate

输出格式

Output Format

报告以 Markdown 格式输出,包含以下部分:
undefined
The report is output in Markdown format, including the following sections:
undefined

📊 A股市场日报

📊 A-share Market Daily Report

YYYY年MM月DD日

YYYY-MM-DD

🎯 大盘概览

🎯 Market Overview

指数收盘点位涨跌幅
上证指数xxxx.xx±x.xx%
深证成指xxxx.xx±x.xx%
创业板指xxxx.xx±x.xx%
科创板指xxxx.xx±x.xx%
市场情绪: 偏多/偏空/中性
⚠️ 数据获取提示: 以下数据获取失败 (指数数据 - 上证指数、深证成指、创业板指、科创板指),可能原因:非交易时间/网络异常/API 暂时不可用

IndexClosing PointChange
Shanghai Composite Indexxxxx.xx±x.xx%
Shenzhen Component Indexxxxx.xx±x.xx%
ChiNext Indexxxxx.xx±x.xx%
STAR Market Indexxxxx.xx±x.xx%
Market Sentiment: Bullish/Bearish/Neutral
⚠️ Data Acquisition Tip: Failed to acquire the following data (index data - Shanghai Composite Index, Shenzhen Component Index, ChiNext Index, STAR Market Index), possible reasons: non-trading hours/network exception/API temporarily unavailable

🔥 热门板块 TOP 5

🔥 Top 5 Popular Sectors

排名板块名称涨跌幅领涨股
1板块名±x.xx%股票名
...

RankSector NameChangeLeading Gainer
1Sector Name±x.xx%Stock Name
...

📈 明日关注

📈 Watchlist for Tomorrow

板块名称关注理由技术面操作建议
板块名理由分析建议
...

Sector NameReason for AttentionTechnical AnalysisOperation Suggestion
Sector NameReasonAnalysisSuggestion
...

⚠️ 风险提示

⚠️ Risk Warning

板块名称风险理由建议
板块名原因建议
...

Sector NameRisk ReasonSuggestion
Sector NameReasonSuggestion
...

💰 资金动向

💰 Capital Trends

  • 主力流入方向: 板块1、板块2、板块3
  • 北向资金: 金额
  • 融资余额: 金额

  • Main Capital Inflow Direction: Sector 1, Sector 2, Sector 3
  • Northbound Capital: Amount
  • Financing Balance: Amount

📝 操作策略

📝 Operation Strategy

  1. 仓位控制: 建议
  2. 关注方向: 建议
  3. 风险控制: 建议
  4. 操作节奏: 建议

数据来源: 东方财富网 生成时间: YYYY-MM-DD
undefined
  1. Position Control: Suggestion
  2. Focus Direction: Suggestion
  3. Risk Control: Suggestion
  4. Operation Rhythm: Suggestion

Data Source: East Money Generation Time: YYYY-MM-DD
undefined