stock-historical-index

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Stock Historical Index

股票指数历史数据获取

Retrieve full historical end-of-day price data for market indices using the Octagon MCP server.
使用Octagon MCP服务器获取市场指数的完整历史每日收盘价数据。

Prerequisites

前提条件

Ensure Octagon MCP is configured in your AI agent (Cursor, Claude Desktop, Windsurf, etc.). See references/mcp-setup.md for installation instructions.
确保你的AI Agent(Cursor、Claude Desktop、Windsurf等)中已配置Octagon MCP。安装说明请查看references/mcp-setup.md

Workflow

操作流程

1. Identify Parameters

1. 确定参数

Determine your query parameters:
  • Index Symbol: ^GSPC (S&P 500), ^DJI (Dow), ^IXIC (NASDAQ), etc.
  • Start Date: Beginning of date range
  • End Date: End of date range
明确你的查询参数:
  • 指数代码: ^GSPC(标普500)、^DJI(道琼斯)、^IXIC(纳斯达克)等。
  • 开始日期: 日期范围的起始时间
  • 结束日期: 日期范围的结束时间

2. Execute Query via Octagon MCP

2. 通过Octagon MCP执行查询

Use the
octagon-agent
tool with a natural language prompt:
Retrieve full historical end-of-day price data for the <INDEX> index from <START_DATE> to <END_DATE>.
MCP Call Format:
json
{
  "server": "octagon-mcp",
  "toolName": "octagon-agent",
  "arguments": {
    "prompt": "Retrieve full historical end-of-day price data for the ^GSPC index from 2025-01-01 to 2025-04-30."
  }
}
使用
octagon-agent
工具,配合自然语言提示词:
Retrieve full historical end-of-day price data for the <INDEX> index from <START_DATE> to <END_DATE>.
MCP调用格式:
json
{
  "server": "octagon-mcp",
  "toolName": "octagon-agent",
  "arguments": {
    "prompt": "Retrieve full historical end-of-day price data for the ^GSPC index from 2025-01-01 to 2025-04-30."
  }
}

3. Expected Output

3. 预期输出

The agent returns comprehensive daily index data:
DateOpenHighLowCloseVolumeChangeChange %VWAP
2025-04-305,499.445,581.845,433.245,569.075.45B+69.63+1.27%5,520.90
2025-04-295,508.875,571.955,505.705,560.824.75B+51.95+0.94%5,536.84
...........................
Key Statistics:
  • Highest single-day volume: 9.49B on 2025-04-09
  • Largest daily gain: +9.90% on 2025-04-09
  • Largest daily loss: -4.12% on 2025-04-04
  • Trading days covered: 79
Data Sources: octagon-stock-data-agent
Agent会返回全面的每日指数数据:
日期开盘价最高价最低价收盘价成交量涨跌点数涨跌幅VWAP
2025-04-305,499.445,581.845,433.245,569.075.45B+69.63+1.27%5,520.90
2025-04-295,508.875,571.955,505.705,560.824.75B+51.95+0.94%5,536.84
...........................
关键统计数据:
  • 单日最高成交量:2025-04-09日的9.49B
  • 单日最大涨幅:2025-04-09日的+9.90%
  • 单日最大跌幅:2025-04-04日的-4.12%
  • 覆盖交易日:79天
数据来源: octagon-stock-data-agent

4. Interpret Results

4. 解读结果

See references/interpreting-results.md for guidance on:
  • Analyzing index price trends
  • Calculating period returns
  • Understanding volume patterns
  • Identifying significant market moves
关于以下内容的指导,请查看references/interpreting-results.md
  • 分析指数价格趋势
  • 计算区间回报率
  • 理解成交量形态
  • 识别重大市场波动

Example Queries

查询示例

S&P 500 History:
Retrieve full historical end-of-day price data for the ^GSPC index from 2025-01-01 to 2025-04-30.
NASDAQ Composite:
Get historical data for ^IXIC from 2024-01-01 to 2024-12-31.
Dow Jones:
Show ^DJI historical prices for Q1 2025.
Russell 2000:
Retrieve historical data for ^RUT from 2024-06-01 to 2025-06-01.
Multiple Indices:
Compare ^GSPC and ^IXIC performance from 2025-01-01 to 2025-03-31.
标普500历史数据:
Retrieve full historical end-of-day price data for the ^GSPC index from 2025-01-01 to 2025-04-30.
纳斯达克综合指数:
Get historical data for ^IXIC from 2024-01-01 to 2024-12-31.
道琼斯指数:
Show ^DJI historical prices for Q1 2025.
罗素2000指数:
Retrieve historical data for ^RUT from 2024-06-01 to 2025-06-01.
多指数对比:
Compare ^GSPC and ^IXIC performance from 2025-01-01 to 2025-03-31.

Common Index Symbols

常用指数代码

US Major Indices

美国主要指数

SymbolIndexDescription
^GSPCS&P 500500 large-cap US stocks
^DJIDow Jones30 blue-chip stocks
^IXICNASDAQ CompositeAll NASDAQ stocks
^NDXNASDAQ 100100 largest NASDAQ
^RUTRussell 20002000 small-cap stocks
代码指数说明
^GSPC标普500500只美国大盘股
^DJI道琼斯30只蓝筹股
^IXIC纳斯达克综合指数所有纳斯达克上市股票
^NDX纳斯达克100100只最大的纳斯达克股票
^RUT罗素20002000只美国小盘股

Sector Indices

行业指数

SymbolIndexDescription
^XLKTechnologyTech sector
^XLFFinancialsFinancial sector
^XLVHealthcareHealthcare sector
^XLEEnergyEnergy sector
^XLIIndustrialsIndustrial sector
代码指数说明
^XLK科技行业指数科技板块
^XLF金融行业指数金融板块
^XLV医疗行业指数医疗板块
^XLE能源行业指数能源板块
^XLI工业行业指数工业板块

Volatility Indices

波动率指数

SymbolIndexDescription
^VIXVIXMarket volatility
^VXNVXNNASDAQ volatility
代码指数说明
^VIXVIX指数市场波动率
^VXNVXN指数纳斯达克波动率

Understanding Index Data

指数数据解读

Price Components

价格构成

FieldDescription
OpenFirst trade price of day
HighHighest price of day
LowLowest price of day
CloseLast trade price of day
VolumeTotal shares traded
ChangePoint change from prior close
Change %Percentage change
VWAPVolume-weighted average price
字段说明
Open当日第一笔成交价
High当日最高价
Low当日最低价
Close当日最后一笔成交价
Volume总成交量
Change较前一日收盘价的涨跌点数
Change %涨跌幅百分比
VWAP成交量加权平均价

Daily Range Analysis

每日区间分析

MetricCalculation
Daily RangeHigh - Low
Range %(High - Low) / Open
Position in Range(Close - Low) / (High - Low)
指标计算公式
当日区间最高价 - 最低价
区间百分比(最高价 - 最低价) / 开盘价
收盘价区间位置(收盘价 - 最低价) / (最高价 - 最低价)

Return Calculations

回报率计算

Period Returns

区间回报率

PeriodFormula
Daily(Close - Prior Close) / Prior Close
Weekly(Friday Close - Monday Open) / Monday Open
Monthly(Month End - Month Start) / Month Start
YTD(Current - Year Start) / Year Start
周期公式
单日(收盘价 - 前一日收盘价) / 前一日收盘价
周度(周五收盘价 - 周一开盘价) / 周一开盘价
月度(月末收盘价 - 月初开盘价) / 月初开盘价
年初至今(当前收盘价 - 年初开盘价) / 年初开盘价

Example

示例

From the data:
  • Start (Jan 2): 5,868.56
  • End (Apr 30): 5,569.07
  • Return: (5,569.07 - 5,868.56) / 5,868.56 = -5.10%
根据数据:
  • 起始(1月2日):5,868.56
  • 结束(4月30日):5,569.07
  • 回报率:(5,569.07 - 5,868.56) / 5,868.56 = -5.10%

Cumulative Returns

累计回报率

Cumulative = (1 + r1) × (1 + r2) × ... × (1 + rn) - 1
Cumulative = (1 + r1) × (1 + r2) × ... × (1 + rn) - 1

Volume Analysis

成交量分析

Volume Patterns

成交量形态

PatternInterpretation
High volume + upStrong buying
High volume + downStrong selling
Low volume + upWeak rally
Low volume + downLack of sellers
形态解读
高成交量 + 上涨买盘强劲
高成交量 + 下跌卖盘强劲
低成交量 + 上涨反弹乏力
低成交量 + 下跌卖盘不足

Volume Metrics

成交量指标

MetricPurpose
Average daily volumeBaseline
Volume spikeUnusual activity
Volume trendParticipation changes
指标用途
日均成交量基准参考
成交量突增异常活动
成交量趋势参与度变化

Example

示例

From the data:
  • Highest volume: 9.49B on 2025-04-09
  • This coincided with +9.90% gain (major rally)
根据数据:
  • 最高成交量:2025-04-09日的9.49B
  • 当日同时出现+9.90%的涨幅(大幅反弹)

Trend Analysis

趋势分析

Trend Identification

趋势识别

PatternCharacteristics
UptrendHigher highs, higher lows
DowntrendLower highs, lower lows
ConsolidationRange-bound
ReversalTrend change
形态特征
上升趋势更高的高点,更高的低点
下降趋势更低的高点,更低的低点
盘整区间震荡
反转趋势改变

Moving Averages

移动平均线

MAUse
50-dayShort-term trend
200-dayLong-term trend
Golden Cross50 > 200 (bullish)
Death Cross50 < 200 (bearish)
MA用途
50日均线短期趋势判断
200日均线长期趋势判断
黄金交叉50日均线上穿200日均线(看涨)
死亡交叉50日均线下穿200日均线(看跌)

Volatility Analysis

波动率分析

Measuring Volatility

波动率衡量

MetricCalculation
Daily Range %(High - Low) / Close
Daily ChangeAbsolute daily change
Std DeviationDispersion of returns
指标计算公式
当日区间百分比(最高价 - 最低价) / 收盘价
当日涨跌单日涨跌绝对值
标准差回报率的离散程度

Volatility Context

波动率场景

Daily Change %Market Condition
<0.5%Low volatility
0.5-1%Normal
1-2%Elevated
>2%High volatility
>4%Extreme
单日涨跌幅%市场状态
<0.5%低波动率
0.5-1%正常
1-2%较高波动率
>2%高波动率
>4%极端波动率

Example

示例

From the data:
  • Largest gain: +9.90%
  • Largest loss: -4.12%
  • Range: 14.02%
  • Interpretation: Period of elevated volatility
根据数据:
  • 最大涨幅:+9.90%
  • 最大跌幅:-4.12%
  • 区间范围:14.02%
  • 解读: 该时段波动率较高

Key Market Events

关键市场事件

Identifying Significant Days

识别关键交易日

CriteriaThreshold
Big up day>2% gain
Big down day>2% loss
Volume spike>2x average
Range expansion>2x normal range
标准阈值
大幅上涨日涨幅>2%
大幅下跌日跌幅>2%
成交量突增成交量>日均2倍
区间扩大区间>正常区间2倍

Event Analysis

事件分析

From DataEvent
+9.90% on Apr 9Major rally
-4.12% on Apr 4Significant selloff
9.49B volumeHighest participation
数据表现事件
4月9日+9.90%大幅反弹
4月4日-4.12%显著抛售
9.49B成交量市场参与度最高

Benchmarking Use

基准对比应用

Stock vs. Index

个股与指数对比

ComparisonFormula
AlphaStock Return - Index Return
BetaStock Vol / Index Vol × Correlation
Relative StrengthStock / Index
对比项公式
Alpha(阿尔法)个股回报率 - 指数回报率
Beta(贝塔)个股波动率 / 指数波动率 × 相关性
相对强度个股价格 / 指数价格

Example Use

示例应用

  • Your stock returned +15%
  • S&P 500 returned -5.10%
  • Alpha: +20.10% outperformance
  • 你的个股回报率为+15%
  • 标普500回报率为-5.10%
  • Alpha:+20.10%(跑赢市场)

Common Use Cases

常见使用场景

Market Context

市场背景查询

What was the overall market doing when my stock fell?
我的个股下跌时,整体市场表现如何?

Return Comparison

回报率对比

How did the S&P 500 perform in Q1 2025?
2025年第一季度标普500表现如何?

Volatility Assessment

波动率评估

What were the biggest up and down days for the market in 2024?
2024年市场最大的上涨和下跌交易日是哪几天?

Trend Analysis

趋势分析

Is the market in an uptrend or downtrend?
当前市场处于上升趋势还是下降趋势?

Volume Analysis

成交量分析

What were the highest volume days for the S&P 500?
标普500成交量最高的交易日是哪几天?

Analysis Tips

分析技巧

  1. Use for context: Index performance explains stock moves.
  2. Calculate alpha: Your returns vs. market.
  3. Watch volume: High volume days are significant.
  4. Track extremes: Big up/down days signal sentiment.
  5. Compare indices: Different indices, different signals.
  6. Consider VIX: Volatility index for fear gauge.
  1. 用于背景参考: 指数表现可以解释个股波动。
  2. 计算Alpha: 你的回报率与市场回报率对比。
  3. 关注成交量: 高成交量交易日具有重要意义。
  4. 追踪极端情况: 大幅涨跌交易日反映市场情绪。
  5. 对比不同指数: 不同指数传递不同信号。
  6. 参考VIX: 波动率指数可作为市场恐慌指标。

Integration with Other Skills

与其他技能集成

SkillCombined Use
stock-performanceStock vs. index comparison
sector-performance-snapshotSector vs. index
stock-quoteCurrent vs. historical
historical-market-capMarket cap vs. index
技能组合用途
stock-performance个股与指数对比
sector-performance-snapshot行业与指数对比
stock-quote当前价格与历史价格对比
historical-market-cap市值与指数对比