btc-momentum-analyzer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBTC 动能理论分析器
BTC Momentum Theory Analyzer
功能概述
Feature Overview
本 Skill 实现基于 MACD 的多时间级别嵌套动能理论分析系统,提供:
-
多时间级别数据获取: 从 OKX API 获取 8 个时间级别的 BTC K线数据
- 2日线 (2d), 1日线 (1d), 12小时 (12h), 6小时 (6h)
- 4小时 (4h), 2小时 (2h), 1小时 (1h), 30分钟 (30m)
-
技术指标计算:
- EMA26, EMA52(短期和中期趋势线)
- MACD(12, 26, 9): DIF(黄线), DEA(白线), Histogram(柱状图)
-
线段分类: 每个时间级别的市场状态识别
- 上涨线段(DEA > 0)
- 下跌线段(DEA < 0)
- 过渡期和突破尝试
-
动能理论分析(详见 THEORY.md):
- 单位调整周期:判断处于第几个调整周期
- 分立调控:检测离散的动能调整模式
- 连续跳空背离:价格与柱状图的背离 + 跳空
- 黄白线背离:DIF 与 DEA 的背离检测
- 隐形信号:隐藏的动能变化
-
多时间级别联动:
- 上级周期对下级周期的影响
- 多周期共振确认
- 嵌套关系的递归分析
-
交易信号生成:
- 买卖点识别(规则定义在 THEORY.md)
- 止损止盈建议
- 置信度评估
This Skill implements a MACD-based nested multi-timeframe momentum theory analysis system, providing:
-
Multi-Timeframe Data Retrieval: Fetch BTC candlestick data for 8 timeframes from the OKX API
- 2-day (2d), 1-day (1d), 12-hour (12h), 6-hour (6h)
- 4-hour (4h), 2-hour (2h), 1-hour (1h), 30-minute (30m)
-
Technical Indicator Calculation:
- EMA26, EMA52 (short-term and medium-term trend lines)
- MACD(12, 26, 9): DIF (yellow line), DEA (white line), Histogram (bar chart)
-
Segment Classification: Identify market status for each timeframe
- Uptrend segment (DEA > 0)
- Downtrend segment (DEA < 0)
- Transition period and breakout attempts
-
Momentum Theory Analysis (see THEORY.md for details):
- Unit Adjustment Cycle: Determine which adjustment cycle the market is in
- Discrete Regulation: Detect discrete momentum adjustment patterns
- Continuous Gap Divergence: Divergence between price and histogram + price gaps
- DIF-DEA Divergence: Detect divergences between DIF and DEA lines
- Hidden Signals: Concealed momentum changes
-
Multi-Timeframe Linkage:
- Influence of higher-level cycles on lower-level cycles
- Confirmation of multi-cycle resonance
- Recursive analysis of nested relationships
-
Trading Signal Generation:
- Identification of buy/sell points (rules defined in THEORY.md)
- Stop-loss and take-profit suggestions
- Confidence level assessment
动能理论体系
Momentum Theory System
完整的理论定义请参考 THEORY.md,包括:
- 上涨线段 / 下跌线段的精确定义
- 单位调整周期的识别方法
- 分立调控的检测算法
- 连续跳空背离的判断标准
- 黄白线背离的分析规则
- 买点 / 卖点的触发条件
- 时间级别联动的分析框架
重要:所有交易参数、阈值、规则均在 THEORY.md 中定义,本 Skill 不包含硬编码的交易逻辑。
Complete theoretical definitions can be found in THEORY.md, including:
- Precise definitions of uptrend/downtrend segments
- Identification methods for unit adjustment cycles
- Detection algorithms for discrete regulation
- Judgment criteria for continuous gap divergences
- Analysis rules for DIF-DEA divergences
- Trigger conditions for buy/sell points
- Analysis framework for timeframe linkage
Important: All trading parameters, thresholds, and rules are defined in THEORY.md. This Skill does not contain hard-coded trading logic.
使用指南
Usage Guide
一键分析(推荐)
One-Click Analysis (Recommended)
Claude 会自动执行完整的分析流程,你只需提问:
示例问题:
- "分析当前 BTC 的动能状态"
- "BTC 现在处于哪个单位调整周期?"
- "检测 BTC 多时间级别的背离情况"
- "BTC 有买点吗?给我详细分析"
Skill 会自动:
- 获取 8 个时间级别的实时数据(OKX API)
- 计算所有指标(EMA26/52, MACD)
- 进行嵌套动能分析
- 生成详细报告
Claude will automatically execute the complete analysis process. You only need to ask:
Example Questions:
- "Analyze the current momentum status of BTC"
- "Which unit adjustment cycle is BTC in now?"
- "Detect multi-timeframe divergences for BTC"
- "Does BTC have a buy signal? Give me a detailed analysis"
The Skill will automatically:
- Fetch real-time data for 8 timeframes (OKX API)
- Calculate all indicators (EMA26/52, MACD)
- Perform nested momentum analysis
- Generate a detailed report
手动执行步骤(高级用户)
Manual Execution Steps (Advanced Users)
如需手动控制分析流程,可按以下步骤执行:
To manually control the analysis process, follow these steps:
第一步:获取多时间级别数据
Step 1: Retrieve Multi-Timeframe Data
bash
python3 /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/scripts/fetch_btc_data.py \
--symbol BTC-USDT \
--timeframes 2d,1d,12h,6h,4h,2h,1h,30m \
--limit 200 \
--exchange okx参数说明:
- : 交易对(OKX 格式:BTC-USDT)
--symbol - : 逗号分隔的时间级别列表
--timeframes - : 每个时间级别获取的 K 线数量
--limit - : 交易所(okx, binance, bybit)
--exchange
输出:JSON 文件,包含所有时间级别的 OHLCV 数据
bash
python3 /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/scripts/fetch_btc_data.py \
--symbol BTC-USDT \
--timeframes 2d,1d,12h,6h,4h,2h,1h,30m \
--limit 200 \
--exchange okxParameter Explanation:
- : Trading pair (OKX format: BTC-USDT)
--symbol - : Comma-separated list of timeframes
--timeframes - : Number of candlesticks to retrieve per timeframe
--limit - : Exchange (okx, binance, bybit)
--exchange
Output: JSON file containing OHLCV data for all timeframes
第二步:计算技术指标
Step 2: Calculate Technical Indicators
bash
python3 /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/scripts/calculate_indicators.py \
/Users/adrian/Desktop/BA/MACD/data/btc_multi_timeframe.json \
--ema-periods 26,52 \
--macd-params 12,26,9输出:带有 EMA 和 MACD 指标的注释数据
bash
python3 /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/scripts/calculate_indicators.py \
/Users/adrian/Desktop/BA/MACD/data/btc_multi_timeframe.json \
--ema-periods 26,52 \
--macd-params 12,26,9Output: Annotated data with EMA and MACD indicators
第三步:动能理论分析
Step 3: Momentum Theory Analysis
bash
python3 /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/scripts/analyze_momentum.py \
/Users/adrian/Desktop/BA/MACD/data/btc_indicators.json \
--theory-file /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/THEORY.md输出:
- 每个时间级别的线段分类
- 单位调整周期判断
- 分立调控检测结果
- 背离分析(连续跳空背离、黄白线背离)
- 多时间级别联动关系
bash
python3 /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/scripts/analyze_momentum.py \
/Users/adrian/Desktop/BA/MACD/data/btc_indicators.json \
--theory-file /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/THEORY.mdOutput:
- Segment classification for each timeframe
- Unit adjustment cycle judgment
- Discrete regulation detection results
- Divergence analysis (continuous gap divergence, DIF-DEA divergence)
- Multi-timeframe linkage relationships
第四步:生成交易报告
Step 4: Generate Trading Report
bash
python3 /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/scripts/generate_report.py \
/Users/adrian/Desktop/BA/MACD/data/btc_analysis.json \
--format text \
--detail full输出:结构化的多时间级别嵌套分析报告
bash
python3 /Users/adrian/Desktop/BA/MACD/.claude/skills/btc-momentum-analyzer/scripts/generate_report.py \
/Users/adrian/Desktop/BA/MACD/data/btc_analysis.json \
--format text \
--detail fullOutput: Structured nested multi-timeframe analysis report
典型输出示例
Typical Output Example
完整动能分析报告
Complete Momentum Analysis Report
=========================
BTC 动能理论分析报告
分析时间: 2025-12-10 16:30:00 UTC
==================================================
BTC Momentum Theory Analysis Report
Analysis Time: 2025-12-10 16:30:00 UTC
=========================多时间级别嵌套分析
Nested Multi-Timeframe Analysis
【2日线级别】
线段状态: 上涨线段
- DEA: +1250.3 (0轴上方,强势多头)
- DIF: +1580.7
- Histogram: +330.4 (持续扩张)
- 线段持续时间: 8 根 K 线
- EMA 排列: EMA26 (98,500) > EMA52 (96,200) ✓
- 单位调整周期: 第 2 个周期
- 周期间背离: 无
- 黄白线背离: 无(DIF 和 DEA 同向上升)
【1日线级别】
线段状态: 上涨线段
- DEA: +850.5 (0轴上方)
- DIF: +920.3
- Histogram: +69.8 (正柱,动能减弱)
- 线段持续时间: 12 根 K 线
- EMA 排列: EMA26 (98,200) > EMA52 (96,800) ✓
- 单位调整周期: 第 1 个周期
- 周期间背离: 无
- 黄白线背离: ⚠️ 轻微背离(价格新高,DIF 未新高)
- 与上级关系: 与 2日线 共振向上
【12小时级别】
线段状态: 上涨线段
- DEA: +420.8
- DIF: +380.2
- Histogram: -40.6 (负柱,动能转弱)
- 线段持续时间: 18 根 K 线
- EMA 排列: EMA26 (98,100) > EMA52 (97,200) ✓
- 单位调整周期: 第 2 个周期
- 周期间背离: ✓ 检测到背离(第1周期高点 vs 第2周期)
- 黄白线背离: ✓ 顶背离(DIF 下穿 DEA,死叉)
- 分立调控: 无
- 与上级关系: 1日线 上涨,但 12h 动能衰竭
【6小时级别】
线段状态: 过渡期(上涨线段后调整)
- DEA: +180.3
- DIF: +120.5
- Histogram: -59.8 (负柱,回调)
- 线段持续时间: 6 根 K 线(过渡期)
- EMA 排列: EMA26 (97,800) < EMA52 (97,850) ✗ (短期破位)
- 单位调整周期: N/A(处于过渡期)
- 分立调控: ✓ 检测到(第 3-5 根 K 线出现离散调整)
- 与上级关系: 12h 背离警告,6h 进入调整
【4小时级别】
线段状态: 过渡期
- DEA: +80.2
- DIF: +50.1
- Histogram: -30.1
- 线段持续时间: 10 根 K 线
- EMA 排列: EMA26 (97,600) < EMA52 (97,700) ✗
- 连续跳空背离: 无
- 黄白线背离: ✓ 死叉背离
- 与上级关系: 6h 调整延续至 4h
【2小时级别】
线段状态: 下跌线段(警告)
- DEA: -20.5 (已下穿 0 轴)
- DIF: -45.3
- Histogram: -24.8
- 线段持续时间: 4 根 K 线
- EMA 排列: EMA26 (97,400) < EMA52 (97,650) ✗
- 单位调整周期: 第 1 个周期(下跌段开始)
- 与上级关系: 4h 调整转为 2h 下跌
【1小时级别】
线段状态: 下跌线段
- DEA: -35.8
- DIF: -50.2
- Histogram: -14.4
- 线段持续时间: 8 根 K 线
- EMA 排列: EMA26 (97,350) < EMA52 (97,550) ✗
- 单位调整周期: 第 1 个周期
- 连续跳空背离: 无
- 黄白线背离: 无(同向下跌)
- 与上级关系: 2h 下跌延续至 1h
【30分钟级别】
线段状态: 下跌线段
- DEA: -45.2
- DIF: -55.8
- Histogram: -10.6
- 线段持续时间: 12 根 K 线
- EMA 排列: EMA26 (97,300) < EMA52 (97,500) ✗
- 单位调整周期: 第 1 个周期
- 隐形信号: ⚠️ 柱状图收敛(可能即将反转)
- 与上级关系: 1h 下跌延续
【2-Day Timeframe】
Segment Status: Uptrend Segment
- DEA: +1250.3 (above 0-axis, strong bullish)
- DIF: +1580.7
- Histogram: +330.4 (continuously expanding)
- Segment Duration: 8 candlesticks
- EMA Arrangement: EMA26 (98,500) > EMA52 (96,200) ✓
- Unit Adjustment Cycle: 2nd cycle
- Inter-Cycle Divergence: None
- DIF-DEA Divergence: None (DIF and DEA rising in the same direction)
【1-Day Timeframe】
Segment Status: Uptrend Segment
- DEA: +850.5 (above 0-axis)
- DIF: +920.3
- Histogram: +69.8 (positive bar, weakening momentum)
- Segment Duration: 12 candlesticks
- EMA Arrangement: EMA26 (98,200) > EMA52 (96,800) ✓
- Unit Adjustment Cycle: 1st cycle
- Inter-Cycle Divergence: None
- DIF-DEA Divergence: ⚠️ Minor divergence (price hit new high, DIF did not)
- Relationship with Higher Timeframe: Resonating upward with 2-day timeframe
【12-Hour Timeframe】
Segment Status: Uptrend Segment
- DEA: +420.8
- DIF: +380.2
- Histogram: -40.6 (negative bar, momentum turning weak)
- Segment Duration: 18 candlesticks
- EMA Arrangement: EMA26 (98,100) > EMA52 (97,200) ✓
- Unit Adjustment Cycle: 2nd cycle
- Inter-Cycle Divergence: ✓ Detected (high of 1st cycle vs 2nd cycle)
- DIF-DEA Divergence: ✓ Bearish divergence (DIF crossed below DEA, death cross)
- Discrete Regulation: None
- Relationship with Higher Timeframe: 1-day timeframe is uptrending, but 12h momentum is exhausted
【6-Hour Timeframe】
Segment Status: Transition Period (adjustment after uptrend)
- DEA: +180.3
- DIF: +120.5
- Histogram: -59.8 (negative bar, pullback)
- Segment Duration: 6 candlesticks (transition period)
- EMA Arrangement: EMA26 (97,800) < EMA52 (97,850) ✗ (short-term breakdown)
- Unit Adjustment Cycle: N/A (in transition period)
- Discrete Regulation: ✓ Detected (discrete adjustment in candlesticks 3-5)
- Relationship with Higher Timeframe: 12h divergence warning, 6h entered adjustment
【4-Hour Timeframe】
Segment Status: Transition Period
- DEA: +80.2
- DIF: +50.1
- Histogram: -30.1
- Segment Duration: 10 candlesticks
- EMA Arrangement: EMA26 (97,600) < EMA52 (97,700) ✗
- Continuous Gap Divergence: None
- DIF-DEA Divergence: ✓ Death cross divergence
- Relationship with Higher Timeframe: 6h adjustment continues to 4h
【2-Hour Timeframe】
Segment Status: Downtrend Segment (warning)
- DEA: -20.5 (crossed below 0-axis)
- DIF: -45.3
- Histogram: -24.8
- Segment Duration: 4 candlesticks
- EMA Arrangement: EMA26 (97,400) < EMA52 (97,650) ✗
- Unit Adjustment Cycle: 1st cycle (start of downtrend)
- Relationship with Higher Timeframe: 4h adjustment turned into 2h downtrend
【1-Hour Timeframe】
Segment Status: Downtrend Segment
- DEA: -35.8
- DIF: -50.2
- Histogram: -14.4
- Segment Duration: 8 candlesticks
- EMA Arrangement: EMA26 (97,350) < EMA52 (97,550) ✗
- Unit Adjustment Cycle: 1st cycle
- Continuous Gap Divergence: None
- DIF-DEA Divergence: None (declining in the same direction)
- Relationship with Higher Timeframe: 2h downtrend continues to 1h
【30-Minute Timeframe】
Segment Status: Downtrend Segment
- DEA: -45.2
- DIF: -55.8
- Histogram: -10.6
- Segment Duration: 12 candlesticks
- EMA Arrangement: EMA26 (97,300) < EMA52 (97,500) ✗
- Unit Adjustment Cycle: 1st cycle
- Hidden Signal: ⚠️ Histogram convergence (potential reversal imminent)
- Relationship with Higher Timeframe: 1h downtrend continues
多时间级别联动总结
Multi-Timeframe Linkage Summary
【大周期趋势】(2日线 - 1日线)
✓ 上涨线段确认
- 2日线 处于第 2 个单位调整周期,强势上涨
- 1日线 出现轻微黄白线背离,需警惕
【中周期调整】(12h - 6h - 4h)
⚠️ 调整期
- 12h 检测到周期间背离 + 黄白线死叉背离
- 6h 发现分立调控,进入过渡期
- 4h 延续调整,动能持续减弱
【小周期下跌】(2h - 1h - 30m)
✗ 短期下跌
- 2h 已确认下跌线段(DEA 下穿 0 轴)
- 1h, 30m 延续下跌,但 30m 出现柱状图收敛(隐形反转信号)
【Large-Cycle Trend】(2-day - 1-day)
✓ Uptrend confirmed
- 2-day timeframe is in the 2nd unit adjustment cycle, strong uptrend
- 1-day timeframe shows minor DIF-DEA divergence, need to be cautious
【Medium-Cycle Adjustment】(12h - 6h - 4h)
⚠️ Adjustment period
- 12h timeframe detected inter-cycle divergence + DIF-DEA death cross divergence
- 6h timeframe found discrete regulation, entered transition period
- 4h timeframe continues adjustment, momentum weakening continuously
【Small-Cycle Downtrend】(2h - 1h - 30m)
✗ Short-term downtrend
- 2h timeframe confirmed downtrend segment (DEA crossed below 0-axis)
- 1h, 30m timeframes continue downtrend, but 30m shows histogram convergence (hidden reversal signal)
交易信号与建议
Trading Signals and Recommendations
【当前市场状态】
多空分歧:大周期多头 vs 小周期空头
【买点分析】
❌ 不建议立即开多单
原因:
- 12h 级别出现明显顶背离(价格新高,DIF 未新高)
- 6h 检测到分立调控,市场处于调整期
- 2h/1h 已确认下跌线段,短期趋势向下
- 需等待小周期企稳后再考虑入场
【潜在买点触发条件】(参考 THEORY.md 规则)
- 30m 级别 DEA 上穿 0 轴,确认反转
- 1h 级别 EMA26 重新上穿 EMA52
- 2h 级别调整结束,与 4h 恢复共振
- 大周期 1日线、2日线 保持上涨线段
【卖点分析】
⚠️ 空单风险提示
原因:
- 大周期(2日线、1日线)仍处于强势上涨线段
- 当前下跌可能只是大周期的正常回调
- 30m 柱状图收敛,可能即将反弹
【建议操作】
观望为主,等待以下情况之一:
- 30m 反转信号确认 → 小仓位做多(顺大周期)
- 2h DEA 继续下穿至 -100 以下 → 考虑短线空单
- 1日线 DEA 下穿 0 轴 → 大周期转向,谨慎做空
【风险等级】: 中等
【置信度】: 60% (观望建议)
【Current Market Status】
Bull-bear divergence: Large-cycle bullish vs small-cycle bearish
【Buy Point Analysis】
❌ Not recommended to open long positions immediately
Reasons:
- 12h timeframe shows obvious bearish divergence (price hit new high, DIF did not)
- 6h timeframe detected discrete regulation, market is in adjustment period
- 2h/1h timeframes confirmed downtrend segments, short-term trend downward
- Wait for small-cycle stabilization before considering entry
【Potential Buy Point Trigger Conditions】(refer to THEORY.md rules)
- 30m timeframe DEA crosses above 0-axis, confirming reversal
- 1h timeframe EMA26 crosses above EMA52 again
- 2h timeframe adjustment ends, resumes resonance with 4h timeframe
- Large-cycle 1-day, 2-day timeframes maintain uptrend segments
【Sell Point Analysis】
⚠️ Short position risk warning
Reasons:
- Large-cycle (2-day, 1-day) timeframes are still in strong uptrend segments
- Current downtrend may just be a normal pullback in the large cycle
- 30m histogram convergence, potential rebound imminent
【Recommended Operations】
Maintain wait-and-see attitude, wait for one of the following situations:
- 30m reversal signal confirmed → Open small long positions (follow large-cycle trend)
- 2h DEA continues to drop below -100 → Consider short-term short positions
- 1-day DEA crosses below 0-axis → Large-cycle trend reversal, short cautiously
【Risk Level】: Medium
【Confidence Level】: 60% (wait-and-see recommendation)
关键监控指标
Key Monitoring Indicators
- 30分钟 Histogram: 收敛后是否放量反转
- 2小时 DEA: 是否继续下探或企稳
- 12小时 黄白线: 背离后是否形成新的多头排列
- 1日线 EMA26/EMA52: 是否保持多头排列
========================= 报告生成时间: 2025-12-10 16:30:12 UTC 数据来源: OKX API 理论依据: THEORY.md (用户自定义动能理论)
undefined- 30-Minute Histogram: Whether it reverses with volume after convergence
- 2-Hour DEA: Whether it continues to decline or stabilizes
- 12-Hour DIF-DEA: Whether a new bullish arrangement forms after divergence
- 1-Day EMA26/EMA52: Whether bullish arrangement is maintained
========================= Report Generation Time: 2025-12-10 16:30:12 UTC Data Source: OKX API Theoretical Basis: THEORY.md (user-defined momentum theory)
undefined数据来源说明
Data Source Explanation
OKX API
OKX API
本 Skill 使用 OKX 交易所的免费公开 API:
优势:
- 免费,无需 API Key(公开数据)
- 支持所有需要的时间级别(2d, 1d, 12h, 6h, 4h, 2h, 1h, 30m)
- 数据质量高,延迟低
- 限制:20 请求/2秒
API 端点:
https://www.okx.com/api/v5/market/candles时间级别映射:
- 2d →
2D - 1d →
1D - 12h →
12H - 6h →
6H - 4h →
4H - 2h →
2H - 1h →
1H - 30m →
30m
This Skill uses the free public API of OKX exchange:
Advantages:
- Free, no API Key required (public data)
- Supports all required timeframes (2d, 1d, 12h, 6h, 4h, 2h, 1h, 30m)
- High data quality, low latency
- Limit: 20 requests/2 seconds
API Endpoint:
https://www.okx.com/api/v5/market/candlesTimeframe Mapping:
- 2d →
2D - 1d →
1D - 12h →
12H - 6h →
6H - 4h →
4H - 2h →
2H - 1h →
1H - 30m →
30m
备用数据源
Alternative Data Sources
-
本地缓存:
- 位置:
/Users/adrian/Desktop/BA/MACD/data/btc_cache_{timeframe}.json - 缓存有效期:根据时间级别动态调整(30m 缓存 5 分钟,2d 缓存 1 小时)
- 位置:
-
Binance API(降级):
- 如果 OKX API 不可用,自动切换
- 注意:Binance 的时间级别名称略有不同
-
手动导出:
- 从 TradingView 或其他平台导出 CSV
- 放置在 目录
data/ - 脚本可自动识别并解析
-
Local Cache:
- Location:
/Users/adrian/Desktop/BA/MACD/data/btc_cache_{timeframe}.json - Cache Validity: Dynamically adjusted based on timeframe (30m cached for 5 minutes, 2d cached for 1 hour)
- Location:
-
Binance API (fallback):
- Automatically switches if OKX API is unavailable
- Note: Binance's timeframe names are slightly different
-
Manual Export:
- Export CSV from TradingView or other platforms
- Place in directory
data/ - Script can automatically recognize and parse
输出格式
Output Formats
文本报告(默认)
Text Report (Default)
结构化的多时间级别嵌套报告,包含:
- 每个时间级别的详细分析
- 线段状态、单位周期、背离检测
- 多时间级别联动总结
- 交易信号和操作建议
- 关键监控指标
Structured nested multi-timeframe report including:
- Detailed analysis for each timeframe
- Segment status, unit cycles, divergence detection
- Multi-timeframe linkage summary
- Trading signals and operation recommendations
- Key monitoring indicators
JSON 报告
JSON Report
bash
--format json机器可读格式,适合进一步处理或存储。
bash
--format jsonMachine-readable format, suitable for further processing or storage.
简化报告
Simplified Report
bash
--detail simple仅包含关键信息和交易建议,适合快速查看。
bash
--detail simpleOnly includes key information and trading recommendations, suitable for quick review.
分析深度控制
Analysis Depth Control
根据需要调整分析的详细程度:
Adjust the level of analysis detail as needed:
完整分析(默认)
Complete Analysis (Default)
bash
python3 scripts/analyze_momentum.py data.json --detail full包含所有 8 个时间级别的完整分析
bash
python3 scripts/analyze_momentum.py data.json --detail fullIncludes complete analysis for all 8 timeframes
重点分析
Focused Analysis
bash
python3 scripts/analyze_momentum.py data.json --focus 1h,4h,1d仅分析指定的时间级别,但仍考虑上下级联动关系
bash
python3 scripts/analyze_momentum.py data.json --focus 1h,4h,1dOnly analyzes specified timeframes, but still considers upper-lower level linkage relationships
快速扫描
Quick Scan
bash
python3 scripts/analyze_momentum.py data.json --mode quick仅输出当前线段状态和关键信号,跳过详细分析
bash
python3 scripts/analyze_momentum.py data.json --mode quickOnly outputs current segment status and key signals, skips detailed analysis
错误处理
Error Handling
脚本内置多层错误处理:
- API 限流:自动等待并重试
- 网络错误:自动重试 3 次,失败后降级到缓存
- 数据缺失:跳过缺失的时间级别,记录警告
- 计算异常:返回 null 值,不中断流程
- THEORY.md 解析错误:使用默认规则并警告用户
The scripts have built-in multi-layer error handling:
- API Rate Limiting: Automatically waits and retries
- Network Errors: Automatically retries 3 times, falls back to cache if failed
- Data Missing: Skips missing timeframes, records warnings
- Calculation Exceptions: Returns null values without interrupting the process
- THEORY.md Parsing Errors: Uses default rules and warns the user
性能优化
Performance Optimization
- 并行获取数据:8 个时间级别并行请求,缩短等待时间
- 增量更新:只获取新增 K 线,减少数据传输
- 智能缓存:根据时间级别动态设置缓存过期时间
- 懒加载:仅在需要时计算详细指标
- Parallel Data Retrieval: 8 timeframes requested in parallel to reduce waiting time
- Incremental Updates: Only fetches new candlesticks, reduces data transmission
- Intelligent Caching: Dynamically sets cache expiration time based on timeframe
- Lazy Loading: Only calculates detailed indicators when needed
相关文件
Related Files
支持的问题类型
Supported Question Types
本 Skill 会在检测到以下关键词时自动激活:
动能分析类:
- "BTC 动能"、"比特币动能状态"
- "分析 BTC"、"BTC 行情分析"
线段和周期类:
- "上涨线段"、"下跌线段"、"线段状态"
- "单位调整周期"、"第几个周期"
- "周期间背离"
背离和信号类:
- "连续跳空背离"、"柱状图背离"
- "黄白线背离"、"DIF DEA 背离"
- "分立调控"、"隐形信号"
交易相关:
- "买点"、"卖点"、"交易信号"
- "开多"、"开空"、"止损"
时间级别:
- "1小时"、"4小时"、"日线"
- "多时间级别"、"时间级别联动"
This Skill automatically activates when detecting the following keywords:
Momentum Analysis:
- "BTC momentum", "Bitcoin momentum status"
- "Analyze BTC", "BTC market analysis"
Segment and Cycle:
- "Uptrend segment", "Downtrend segment", "Segment status"
- "Unit adjustment cycle", "Which cycle"
- "Inter-cycle divergence"
Divergence and Signals:
- "Continuous gap divergence", "Histogram divergence"
- "DIF-DEA divergence", "DIF DEA divergence"
- "Discrete regulation", "Hidden signal"
Trading Related:
- "Buy point", "Sell point", "Trading signal"
- "Open long", "Open short", "Stop-loss"
Timeframes:
- "1-hour", "4-hour", "Daily"
- "Multi-timeframe", "Timeframe linkage"
限制和注意事项
Limitations and Notes
-
THEORY.md 必须完善:
- 本 Skill 不包含任何硬编码的交易逻辑
- 所有规则、参数、阈值均从 THEORY.md 读取
- 如果 THEORY.md 不完整,分析结果可能不准确
-
数据延迟:
- OKX API 数据可能有 1-2 秒延迟
- 大周期(2日线)数据更新较慢
-
指标精度:
- Python 计算的 MACD 与 TradingView 可能有微小差异
- EMA 初始值计算方式需与你的理论一致
-
API 限制:
- OKX: 20 请求/2秒
- 8 个时间级别 = 8 个请求,约 1 秒完成
-
风险提示:
- 本 Skill 仅提供分析参考,不构成投资建议
- 多时间级别可能出现矛盾信号,需综合判断
-
THEORY.md Must Be Completed:
- This Skill does not contain any hard-coded trading logic
- All rules, parameters, and thresholds are read from THEORY.md
- If THEORY.md is incomplete, analysis results may be inaccurate
-
Data Latency:
- OKX API data may have 1-2 seconds of latency
- Large-cycle (2-day) data updates slower
-
Indicator Accuracy:
- MACD calculated by Python may have minor differences from TradingView
- EMA initial value calculation method must match your theory
-
API Limits:
- OKX: 20 requests/2 seconds
- 8 timeframes = 8 requests, completed in approximately 1 second
-
Risk Warning:
- This Skill only provides analysis references, does not constitute investment advice
- Multi-timeframe may have conflicting signals, need comprehensive judgment
维护和更新
Maintenance and Updates
- 脚本位置:
.claude/skills/btc-momentum-analyzer/scripts/ - 理论更新:修改 THEORY.md 后立即生效,无需重启
- 参数调整:所有参数在 THEORY.md 中配置
- 版本控制:通过 git 提交更新,团队成员自动同步
- Script Location:
.claude/skills/btc-momentum-analyzer/scripts/ - Theory Updates: Takes effect immediately after modifying THEORY.md, no restart required
- Parameter Adjustments: All parameters configured in THEORY.md
- Version Control: Submit updates via git, team members sync automatically
下一步
Next Steps
-
完善 THEORY.md:
- 定义所有动能理论概念
- 指定买卖点触发条件
- 配置所有阈值和参数
-
测试数据获取:bash
python3 scripts/fetch_btc_data.py --symbol BTC-USDT --timeframes 1h --limit 10 -
验证指标计算:
- 对比 Python 计算结果与 TradingView
- 确保 EMA26/52 和 MACD 数值一致
-
完整分析测试:
- 运行完整分析流程
- 检查报告格式和内容
- 根据实际交易经验调整 THEORY.md
重要提示:本 Skill 的核心是 THEORY.md,请务必完整填写该文件中的所有规则和定义。Skill 会严格按照你定义的理论进行分析,不会添加任何主观判断。
-
Complete THEORY.md:
- Define all momentum theory concepts
- Specify buy/sell point trigger conditions
- Configure all thresholds and parameters
-
Test Data Retrieval:bash
python3 scripts/fetch_btc_data.py --symbol BTC-USDT --timeframes 1h --limit 10 -
Verify Indicator Calculation:
- Compare Python calculation results with TradingView
- Ensure EMA26/52 and MACD values are consistent
-
Complete Analysis Test:
- Run the complete analysis process
- Check report format and content
- Adjust THEORY.md based on actual trading experience
Important Note: The core of this Skill is THEORY.md. Please ensure all rules and definitions in this file are fully completed. The Skill will strictly analyze according to your defined theory, without adding any subjective judgments.