← 返回 Skills 市场
zhaocaixia888

China Technical Analysis

作者 zhaocaixia888 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
48
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install china-technical-analysis
功能描述
Compute and analyze technical indicators (MACD, KDJ, RSI, Moving Averages, Bollinger Bands) for Chinese futures markets. Generate buy/sell signals and chart...
使用说明 (SKILL.md)

China Technical Analysis — 中国期货技术分析

Compute technical indicators and generate trading signals for Chinese commodity futures, financial index futures, crude oil, and shipping index markets.

Use this skill when:

  • User asks for MACD, KDJ, RSI, 金叉死叉, or any technical indicator analysis
  • User wants buy/sell signals for a specific futures contract
  • User asks to "看下XX的走势" or "分析一下XX的技术面"
  • User wants to know if a contract is overbought/oversold
  • User wants channel, support/resistance levels

Quick Start

Recommended Flow

  1. Fetch quote data → Use china-commodity-quotes to get price data for the target contract
  2. Calculate indicators → Use formulas below to compute MACD, MA, RSI, Bollinger Bands, KDJ
  3. Generate signal → Combine indicators and output buy/sell/neutral recommendation
  4. Present result → Format with clear buy/sell signals and chart description

Data Sources

Through china-commodity-quotes, you can get:

  • open, high, low, close (daily or intraday)
  • volume and open_interest
  • Historical bar data via Sina Finance API

For multi-day historical data (best for indicators):

https://stock2.finance.sina.com.cn/futures/api/jsonp.php/var%20_=new%20Date().getTime()/InnerFuturesNewService.getDailyKLine?symbol=\x3CCONTRACT_CODE>&datalen=\x3CDAYS>

Example (curl):

curl -s "https://stock2.finance.sina.com.cn/futures/api/jsonp.php/InnerFuturesNewService.getDailyKLine?symbol=IF0&datalen=60"

For minute-level data:

https://stock2.finance.sina.com.cn/futures/api/jsonp.php/InnerFuturesNewService.getMinLine?symbol=\x3CCONTRACT_CODE>&type=\x3CM1|M5|M15|M30|M60>

Technical Indicator Formulas

1. Moving Averages (MA — 均线系统)

Simple Moving Average (SMA):

SMA(n) = (C1 + C2 + ... + Cn) / n

Where C = closing price, n = period

Common periods for Chinese futures:

  • MA5 (5-day) — short-term trend
  • MA10 (10-day) — short-term support/resistance
  • MA20 (MA20) — mid-term trend
  • MA60 (60-day) — long-term trend
  • MA120 (120-day) — major trend line

Golden Cross (金叉) — Buy Signal: Short-term MA crosses ABOVE long-term MA (e.g., MA5 上穿 MA20)

Death Cross (死叉) — Sell Signal: Short-term MA crosses BELOW long-term MA (e.g., MA5 下穿 MA20)

2. MACD (指数平滑异同移动平均线)

Step-by-step calculation:

Step 1: EMA12 = EMA(C, 12)    — Fast EMA
Step 2: EMA26 = EMA(C, 26)    — Slow EMA
Step 3: DIF = EMA12 - EMA26    — Difference
Step 4: DEA = EMA(DIF, 9)      — Signal line (9-day EMA of DIF)
Step 5: MACD bar = 2 × (DIF - DEA)   — Histogram

EMA calculation (recursive):

EMA(today) = (C × K) + (EMA(yesterday) × (1 - K))
Where K = 2 / (N + 1)

Signals:

Signal Condition Interpretation
Golden cross DIF crosses above DEA Bullish 🟢
Death cross DIF crosses below DEA Bearish 🔴
Zero crossing (up) DIF crosses above 0 Trend turning bullish
Zero crossing (down) DIF crosses below 0 Trend turning bearish
Divergence (bullish) Price lower low, MACD higher low Reversal up ⬆️
Divergence (bearish) Price higher high, MACD lower high Reversal down ⬇️

3. RSI (相对强弱指标)

RSI(n) = 100 - [100 / (1 + RS)]
RS = AvgGain(n) / AvgLoss(n)

Where:

  • AvgGain(n) = average of up-moves over n periods
  • AvgLoss(n) = average of down-moves over n periods
  • Default period: n = 14

Interpretation:

RSI Range Signal
> 80 Overbought (超买) — potential sell ⚠️
70 - 80 Strongly bullish, nearing overbought
30 - 70 Normal range
20 - 30 Strongly bearish, nearing oversold
\x3C 20 Oversold (超卖) — potential buy ⚠️

4. Bollinger Bands (布林带)

Middle Band = SMA(n)
Upper Band  = Middle Band + (k × StdDev(n))
Lower Band  = Middle Band - (k × StdDev(n))

Where:

  • n = 20 (default period)
  • k = 2 (default multiplier)
  • StdDev = standard deviation of closing prices

Interpretation:

Pattern Meaning
Price touches upper band Overbought; potential resistance
Price touches lower band Oversold; potential support
Price breaks above upper band Strong momentum; trend continuation
Price breaks below lower band Strong momentum; trend continuation
Bands squeeze (narrowing) Low volatility; impending breakout
Bands expand (widening) High volatility

5. KDJ (随机指标 — Chinese Traders' Favorite)

KDJ is a derivative of the Stochastic Oscillator, widely used by Chinese futures traders.

Step 1: RSV = (C - L9) / (H9 - L9) × 100
   Where C = today's close, L9 = lowest low of 9 periods, H9 = highest high of 9 periods

Step 2: K = (2/3 × K(yesterday)) + (1/3 × RSV)
Step 3: D = (2/3 × D(yesterday)) + (1/3 × K(today))
Step 4: J = (3 × K) - (2 × D)

Interpretation:

Value Meaning
K > D Uptrend
K \x3C D Downtrend
K/D/J > 80 Overbought
K/D/J \x3C 20 Oversold
Golden cross (K ↑ D) Buy signal (especially \x3C 20)
Death cross (K ↓ D) Sell signal (especially > 80)
J > 100 Top warning 🔴
J \x3C 0 Bottom warning 🟢

Signal Generation Logic

Composite Signal Scoring

Assign weights to get a combined signal:

Indicator Buy Signal Sell Signal Weight
MACD DIF ↑ DEA, DIF > 0 DIF ↓ DEA, DIF \x3C 0 30%
RSI RSI \x3C 30 → oversold RSI > 70 → overbought 20%
MA Price > MA5 > MA10 > MA20 Price \x3C MA5 \x3C MA10 \x3C MA20 25%
Bollinger Price at/below lower band Price at/above upper band 10%
KDJ K ↑ D \x3C 20 K ↓ D > 80 15%

Overall:

  • Score ≥ 60 → Buy 🟢
  • Score ≤ -60 → Sell 🔴
  • Otherwise → Neutral ⚪

Support & Resistance

Support levels (支撑位):

  • Previous lows
  • MA20, MA60
  • Lower Bollinger Band
  • Fibonacci retracement levels (0.382, 0.5, 0.618)

Resistance levels (压力位):

  • Previous highs
  • MA20 (acting as resistance in downtrend)
  • Upper Bollinger Band
  • Fibonacci retracement levels

Scripts

scripts/indicators.py

Core technical indicator calculation engine:

  • sma(data, period) — Simple Moving Average
  • ema(data, period) — Exponential Moving Average
  • macd(data) — MACD (DIF, DEA, histogram)
  • rsi(data, period=14) — RSI
  • bollinger(data, period=20, k=2) — Bollinger Bands
  • kdj(data) — KDJ indicator
  • golden_death_cross(short_ma, long_ma) — Detect 金叉/死叉
  • composite_signal(data) — Combine all indicators → final signal

Example Output

📉 沪深300 (IF2606) 技术分析

📊 均线系统
  MA5:  3850.2  |  MA10: 3820.5  |  MA20: 3790.8
  ⚡ 金叉确认: MA5 上穿 MA10 ✅

📊 MACD (12,26,9)
  DIF: +8.50  |  DEA: +5.20  |  柱: +6.60
  🟢 MACD金叉,DIF在零轴上方

📊 RSI(14): 62.5
  ⚪ 正常区间,偏强

📊 布林带 (20,2)
  上轨: 3920.0  |  中轨: 3790.8  |  下轨: 3661.6
  价格接近中轨,布林带略微扩张

📊 KDJ(9,3,3)
  K: 68.2  |  D: 62.5  |  J: 79.6
  ⚠️ J值接近80,注意超买风险

━━━━━━━━━━━━━━━━━━━━━
🟢 BUY 信号 (评分: +65/100)
  主要支撑: 3790 (MA20)
  主要压力: 3850 (前高) / 3920 (布林上轨)

💡 建议: 短线偏多,注意J值高位回调风险
  止损参考: 3780 (-0.5%)

Important Notes

  • Technical analysis provides probability-based signals, not guarantees
  • Always combine with fundamentals and market news
  • Chinese futures markets have unique characteristics (夜盘, limit up/down rules)
  • KDJ is particularly popular among Chinese retail traders; MACD + MA combo is preferred by institutions
  • The script scripts/indicators.py can be called directly for batch analysis
安全使用建议
Before installing, understand that the skill may query external Sina Finance endpoints for market data and may produce trading signals. Use those signals as technical-analysis context only, and verify market data and risk independently before making financial decisions.
能力评估
Purpose & Capability
The artifacts coherently support market-data technical indicators and buy/sell signal generation; the financial nature means users should treat outputs as informational, not authoritative advice.
Instruction Scope
Runtime instructions are limited to fetching quote data, calculating indicators, and presenting analysis; no prompt override, unrelated behavior, or hidden action was found.
Install Mechanism
Metadata declares only curl and a dependency on china-commodity-quotes, with no environment variables, package installs, or unusual installation steps.
Credentials
Network access to Sina Finance market-data endpoints is disclosed and proportionate to the skill's purpose; the Python script performs local indicator calculations only.
Persistence & Privilege
No persistence, privilege escalation, credential/session access, destructive actions, or background execution behavior was present.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install china-technical-analysis
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /china-technical-analysis 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug china-technical-analysis
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

China Technical Analysis 是什么?

Compute and analyze technical indicators (MACD, KDJ, RSI, Moving Averages, Bollinger Bands) for Chinese futures markets. Generate buy/sell signals and chart... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 48 次。

如何安装 China Technical Analysis?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install china-technical-analysis」即可一键安装,无需额外配置。

China Technical Analysis 是免费的吗?

是的,China Technical Analysis 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

China Technical Analysis 支持哪些平台?

China Technical Analysis 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 China Technical Analysis?

由 zhaocaixia888(@zhaocaixia888)开发并维护,当前版本 v1.0.0。

💬 留言讨论