crypto-kline-analysis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCrypto K-line Analysis Skill
加密货币K线分析技能
An intelligent AI skill that performs comprehensive cryptocurrency technical analysis using real-time data from Binance API.
这是一个智能AI技能,可通过Binance API获取的实时数据完成全面的加密货币技术分析。
🚀 Quick Usage
🚀 快速使用
For AI Agents calling this skill:
bash
undefined供AI Agent调用该技能的方式:
bash
undefinedAnalyze BTC/USDT (default - full analysis)
分析BTC/USDT(默认 - 全量分析)
python crypto_analyzer.py
python crypto_analyzer.py
Analyze specific trading pair
分析指定交易对
python crypto_analyzer.py ETH/USDT
python crypto_analyzer.py ETH/USDT
Long-term analysis only (4h + daily)
仅做长期分析(4小时+日线级别)
python crypto_analyzer.py BTC/USDT long
python crypto_analyzer.py BTC/USDT long
Short-term analysis only (15m + 1h)
仅做短期分析(15分钟+1小时级别)
python crypto_analyzer.py BTC/USDT short
**What it does:**
- ✅ Fetches real-time K-line data from Binance
- ✅ Calculates 10+ technical indicators
- ✅ Analyzes trends across multiple timeframes
- ✅ Identifies potential tops and bottoms
- ✅ Detects divergences and crossovers
- ✅ Generates actionable trading recommendations
**Output:** Comprehensive technical analysis report with clear trend direction, signal strength, and trading suggestions.
---python crypto_analyzer.py BTC/USDT short
**功能说明:**
- ✅ 从Binance获取实时K线数据
- ✅ 计算10+种技术指标
- ✅ 跨多时间维度分析趋势
- ✅ 识别潜在顶底位置
- ✅ 检测背离与交叉信号
- ✅ 生成可落地的交易建议
**输出内容:** 完整的技术分析报告,包含清晰的趋势方向、信号强度以及交易建议。
---Core Capabilities
核心能力
This skill provides complete cryptocurrency technical analysis:
- ✅ Long-term Analysis - 4-hour and daily timeframe trend detection with EMA alignment
- ✅ Trend Identification - Determine bullish/bearish/sideways trends with strength indicators
- ✅ Top/Bottom Detection - Identify potential reversal points using RSI, StochRSI, and Bollinger Bands
- ✅ Short-term Signals - Fast 15-minute and 1-hour signals for entry/exit timing
- ✅ Divergence Detection - Spot price-indicator divergences (bullish/bearish)
- ✅ Comprehensive Reporting - Clear, actionable analysis with risk warnings
该技能提供完整的加密货币技术分析服务:
- ✅ 长期分析 - 基于EMA对齐规则的4小时、日线级别趋势检测
- ✅ 趋势识别 - 通过强度指标判定上涨/下跌/震荡趋势
- ✅ 顶底检测 - 结合RSI、StochRSI和Bollinger Bands识别潜在反转点
- ✅ 短期信号 - 15分钟、1小时级别的快周期进出场时机信号
- ✅ 背离检测 - 识别价格-指标背离(上涨/下跌背离)
- ✅ 完整报告 - 清晰可落地的分析结果,附带风险提示
When to Use This Skill
适用场景
Use this skill when the user wants to:
- Analyze cryptocurrency price trends (BTC, ETH, etc.)
- Get technical analysis for trading decisions
- Identify potential entry or exit points
- Understand market trend direction and strength
- Detect overbought/oversold conditions
- Analyze multiple timeframes simultaneously
- Get actionable trading recommendations
当用户有以下需求时可使用该技能:
- 分析加密货币(BTC、ETH等)价格趋势
- 获取交易决策所需的技术分析结果
- 识别潜在的进场或出场点位
- 了解市场趋势方向与强度
- 检测超买/超卖状态
- 同时分析多时间维度行情
- 获取可落地的交易建议
Technical Indicators Implemented
已实现的技术指标
Moving Averages
移动平均线
- EMA (9, 21, 50, 200)
- SMA (20, 50)
- EMA (9, 21, 50, 200)
- SMA (20, 50)
Momentum Indicators
动量指标
- RSI (14) - Relative Strength Index
- Stochastic RSI - Enhanced momentum indicator
- RSI (14) - 相对强弱指数
- Stochastic RSI - 增强型动量指标
Trend Indicators
趋势指标
- MACD (12, 26, 9) - Moving Average Convergence Divergence
- Bollinger Bands (20, 2) - Volatility bands
- MACD (12, 26, 9) - 指数平滑异同移动平均线
- Bollinger Bands (20, 2) - 布林带
Volatility & Volume
波动率与成交量
- ATR (14) - Average True Range
- Volume SMA (20) - Volume moving average
- ATR (14) - 平均真实波动幅度
- Volume SMA (20) - 成交量移动平均线
Complete Workflow
完整工作流程
1. Understand User Request
1. 理解用户需求
When the user requests cryptocurrency analysis, extract and confirm:
Required Information:
- Trading pair: Which cryptocurrency to analyze (e.g., BTC/USDT, ETH/USDT)
- Analysis type: Long-term, short-term, or comprehensive (all)
- Specific questions: Any particular concerns (trend direction, entry points, etc.)
Example User Requests:
- "Analyze BTC price trend"
- "Is ETH overbought right now?"
- "Give me a long-term analysis of BTC"
- "What's the short-term signal for SOL?"
What YOU Must Do:
- Identify the cryptocurrency symbol
- Determine analysis scope (long/short/all)
- Confirm the trading pair format (symbol/USDT)
当用户请求加密货币分析时,提取并确认以下信息:
必填信息:
- 交易对:需要分析的加密货币(如BTC/USDT、ETH/USDT)
- 分析类型:长期、短期、或全量分析
- 特定问题:用户的具体关注点(趋势方向、进场点等)
用户请求示例:
- "分析BTC的价格趋势"
- "ETH现在是不是超买了?"
- "给我一份BTC的长期分析报告"
- "SOL的短期信号是什么?"
你需要完成的操作:
- 识别加密货币代码
- 确定分析范围(长期/短期/全量)
- 确认交易对格式(币种/USDT)
2. Fetch K-line Data
2. 获取K线数据
Navigate to the skill directory and fetch real-time market data:
bash
cd ~/.claude/skills/crypto-kline-analysis
source venv/bin/activate
python crypto_analyzer.py BTC/USDT [timeframe]Data Retrieved:
- 4-hour K-lines (200 candles)
- Daily K-lines (200 candles)
- 1-hour K-lines (200 candles)
- 15-minute K-lines (200 candles)
- 24-hour ticker information
进入技能目录并获取实时市场数据:
bash
cd ~/.claude/skills/crypto-kline-analysis
source venv/bin/activate
python crypto_analyzer.py BTC/USDT [timeframe]获取的数据包括:
- 4小时K线(200根蜡烛图)
- 日线K线(200根蜡烛图)
- 1小时K线(200根蜡烛图)
- 15分钟K线(200根蜡烛图)
- 24小时行情信息
3. Technical Analysis Process
3. 技术分析流程
The tool automatically:
- Calculates Indicators - Computes all technical indicators on each timeframe
- Analyzes Trends - Determines trend direction using EMA alignment
- Detects Top/Bottom - Identifies overbought/oversold conditions
- Finds Divergences - Spots price-indicator divergences
- Generates Signals - Creates bullish/bearish/neutral signals
工具会自动完成以下操作:
- 计算指标 - 在每个时间维度上计算所有技术指标
- 分析趋势 - 通过EMA对齐规则判定趋势方向
- 顶底检测 - 识别超买/超卖状态
- 背离识别 - 检测价格-指标背离情况
- 生成信号 - 输出上涨/下跌/中性信号
4. Interpret Analysis Results
4. 解读分析结果
CRITICAL: You MUST interpret the results for the user.
The tool outputs sections for:
关键要求:你必须为用户解读分析结果。
工具输出包含以下模块:
Long-term Analysis (4h & Daily)
长期分析(4小时&日线)
- Trend Direction: Strong Bullish, Bullish, Sideways, Bearish, Strong Bearish
- Trend Strength: Strong, Medium, Weak
- EMA Alignment: Current price vs EMAs (9, 21, 50, 200)
- MACD Status: Golden Cross (bullish) or Death Cross (bearish)
- Position: Potential Top, Potential Bottom, or Neutral
- RSI Level: Overbought (>70), Oversold (<30), or Neutral
- 趋势方向:强势上涨、上涨、震荡、下跌、强势下跌
- 趋势强度:强、中、弱
- EMA对齐情况:当前价格与EMA(9,21,50,200)的关系
- MACD状态:金叉(看涨)或死叉(看跌)
- 位置判断:潜在顶部、潜在底部、中性
- RSI水平:超买(>70)、超卖(<30)、中性
Short-term Analysis (15m & 1h)
短期分析(15分钟&1小时)
- Short-term Trend: Bullish or Bearish
- Quick Signals: RSI conditions, MACD crossovers
- Entry Timing: Overbought/oversold on shorter timeframes
- 短期趋势:上涨或下跌
- 快速信号:RSI状态、MACD交叉情况
- 进场时机:短周期维度的超买/超卖状态
5. Provide Clear Summary to User
5. 为用户提供清晰的总结
CRITICAL: Always translate the technical output into actionable insights.
Your Summary Must Include:
✅ For Bullish Signals:
📈 BTC/USDT Analysis Summary
Current Trend: Strong Bullish
- Daily trend is up with EMA(9) > EMA(21) > EMA(50)
- MACD showing golden cross on 4h timeframe
- Price above 200-day EMA = Bull market confirmed
Key Signals:
✅ Long-term trend is strong and upward
✅ Momentum indicators support continued upside
⚠️ Watch for RSI overbought on daily (currently 68)
Recommendation: Bullish bias - Consider holding or buying on dips
Risk: Monitor for RSI >70 which may signal short-term pullback❌ For Bearish Signals:
📉 BTC/USDT Analysis Summary
Current Trend: Strong Bearish
- Daily trend is down with EMA(9) < EMA(21) < EMA(50)
- MACD showing death cross on daily timeframe
- Price below 200-day EMA = Bear market confirmed
Key Signals:
❌ Long-term trend is weak and downward
❌ Multiple timeframes confirm bearish structure
💡 RSI oversold on daily (currently 28) = potential bounce
Recommendation: Bearish bias - Consider staying in cash or waiting
Opportunity: Watch for bullish divergence on RSI for reversal signal📊 Always Include:
- Clear trend direction (bullish/bearish/sideways)
- Trend strength across timeframes
- Key support/resistance levels (EMAs)
- Overbought/oversold conditions
- Specific entry/exit suggestions
- Risk warnings and disclaimers
关键要求:始终将技术输出转化为可落地的洞察。
你的总结必须包含:
✅ 上涨信号场景:
📈 BTC/USDT分析总结
当前趋势:强势上涨
- 日线趋势向上,EMA(9) > EMA(21) > EMA(50)
- 4小时级别MACD出现金叉
- 价格高于200日线EMA = 确认牛市
核心信号:
✅ 长期趋势强劲向上
✅ 动量指标支持后续上涨空间
⚠️ 注意日线RSI超买风险(当前为68)
建议:看涨倾向 - 可考虑持有或逢低买入
风险:关注RSI突破70的情况,可能预示短期回调❌ 下跌信号场景:
📉 BTC/USDT分析总结
当前趋势:强势下跌
- 日线趋势向下,EMA(9) < EMA(21) < EMA(50)
- 日线级别MACD出现死叉
- 价格低于200日线EMA = 确认熊市
核心信号:
❌ 长期趋势疲软向下
❌ 多时间维度确认下跌结构
💡 日线RSI超卖(当前为28)= 可能出现反弹
建议:看跌倾向 - 可考虑持有现金或继续观望
机会:关注RSI出现看涨背离的反转信号📊 所有场景都需要包含:
- 清晰的趋势方向(上涨/下跌/震荡)
- 跨时间维度的趋势强度
- 关键支撑/阻力位(EMAs)
- 超买/超卖状态
- 具体的进出场建议
- 风险提示与免责声明
6. Answer Follow-up Questions
6. 解答后续问题
After providing analysis, be ready to clarify:
Common Questions:
- "What does MACD golden cross mean?" → Explain bullish momentum shift
- "Is it a good time to buy?" → Reference trend + RSI + position analysis
- "What's the risk?" → Explain overbought conditions or trend weakness
- "When should I sell?" → Reference resistance levels and trend changes
Important Reminders:
- Always include disclaimer: "This is for educational purposes only, not financial advice"
- Emphasize that crypto markets are highly volatile
- Recommend proper risk management
- Suggest the user do their own research
提供分析后,随时准备解答用户的疑问:
常见问题:
- "MACD金叉是什么意思?" → 解释上涨动量切换
- "现在适合买入吗?" → 结合趋势+RSI+位置分析给出参考
- "风险有哪些?" → 解释超买状态或趋势疲软的影响
- "我应该什么时候卖出?" → 参考阻力位和趋势变化情况
重要提示:
- 始终附带免责声明:"本内容仅用于教育目的,不构成任何投资建议"
- 强调加密货币市场波动性极高
- 建议用户做好 proper 风险管理
- 提示用户自行做好研究
Environment Setup
环境搭建
1. Install Dependencies
1. 安装依赖
bash
cd crypto-kline-analysis
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtbash
cd crypto-kline-analysis
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt2. Test Installation
2. 测试安装
bash
undefinedbash
undefinedActivate virtual environment
激活虚拟环境
source venv/bin/activate
source venv/bin/activate
Run test analysis
运行测试分析
python crypto_analyzer.py BTC/USDT long
**No API keys required** - Uses Binance public API endpoints.python crypto_analyzer.py BTC/USDT long
**无需API密钥** - 调用Binance公开API接口即可。Analysis Methodology
分析方法
Trend Detection Logic
趋势检测逻辑
-
EMA Alignment Check
- Strong Bullish: EMA(9) > EMA(21) > EMA(50)
- Bullish: EMA(9) > EMA(21)
- Strong Bearish: EMA(9) < EMA(21) < EMA(50)
- Bearish: EMA(9) < EMA(21)
- Sideways: Mixed or no clear alignment
-
MACD Confirmation
- Golden Cross: MACD line crosses above signal line (bullish)
- Death Cross: MACD line crosses below signal line (bearish)
-
Long-term Market Structure
- Above 200 EMA = Bull market
- Below 200 EMA = Bear market
-
EMA对齐校验
- 强势上涨:EMA(9) > EMA(21) > EMA(50)
- 上涨:EMA(9) > EMA(21)
- 强势下跌:EMA(9) < EMA(21) < EMA(50)
- 下跌:EMA(9) < EMA(21)
- 震荡:EMA对齐混乱无明确方向
-
MACD确认
- 金叉:MACD线上穿信号线(看涨)
- 死叉:MACD线下穿信号线(看跌)
-
长期市场结构
- 高于200 EMA = 牛市
- 低于200 EMA = 熊市
Top/Bottom Detection Logic
顶底检测逻辑
-
RSI Levels
- RSI < 30 = Oversold (potential bottom)
- RSI > 70 = Overbought (potential top)
- RSI 40-60 = Neutral zone
-
StochRSI Confirmation
- StochRSI < 20 = Strong oversold
- StochRSI > 80 = Strong overbought
-
Bollinger Bands Position
- Price near upper band = Overbought zone
- Price near lower band = Oversold zone
-
Divergence Detection
- Bearish: Price makes new high, RSI doesn't (potential top)
- Bullish: Price makes new low, RSI doesn't (potential bottom)
-
RSI水平
- RSI < 30 = 超卖(潜在底部)
- RSI > 70 = 超买(潜在顶部)
- RSI 40-60 = 中性区间
-
StochRSI确认
- StochRSI < 20 = 强超卖
- StochRSI > 80 = 强超买
-
Bollinger Bands位置
- 价格接近上轨 = 超买区间
- 价格接近下轨 = 超卖区间
-
背离检测
- 看跌背离:价格创新高,RSI未同步创新高(潜在顶部)
- 看涨背离:价格创新低,RSI未同步创新低(潜在底部)
Usage Examples
使用示例
Example 1: Basic Trend Check
示例1:基础趋势查询
User: "What's the BTC trend right now?"
Agent Actions:
- Run:
python crypto_analyzer.py BTC/USDT long - Analyze output
- Respond with clear summary
Agent Response:
BTC/USDT is currently in a Strong Bearish trend on the daily timeframe:
📉 Daily: Strong Bearish (EMA 9 < 21 < 50)
📉 4-hour: Bearish
💡 Price is below 200-day EMA ($102,074) = Bear market
⚠️ MACD death cross confirmed
However, daily RSI is at 35 (approaching oversold), which may signal
a potential bounce in the near term.
Conclusion: Strong downtrend with possible short-term bounce opportunity.用户: "现在BTC的趋势是什么样的?"
Agent操作:
- 运行命令:
python crypto_analyzer.py BTC/USDT long - 分析输出结果
- 返回清晰的总结
Agent回复:
BTC/USDT当前日线级别处于强势下跌趋势:
📉 日线:强势下跌(EMA 9 < 21 < 50)
📉 4小时:下跌
💡 价格低于200日线EMA(102074美元)= 确认熊市
⚠️ MACD死叉已确认
不过日线RSI为35(接近超卖),可能预示短期内会出现反弹。
结论:趋势强劲向下,短期存在反弹机会。Example 2: Entry Point Analysis
示例2:进场点分析
User: "Is this a good entry point for ETH?"
Agent Actions:
- Run:
python crypto_analyzer.py ETH/USDT all - Check both long-term trend AND short-term signals
- Provide balanced assessment
Agent Response:
ETH/USDT Entry Analysis:
Long-term (Daily): Bearish trend, price below key EMAs
Short-term (1h): Showing bullish divergence, RSI oversold at 28
Signals:
✅ Short-term RSI oversold = potential bounce
⚠️ Long-term trend still bearish
⚠️ Price below 200 EMA
Assessment: Risky for long-term entry, but short-term bounce trade
possible if you have tight stop-loss.
Safer entry would be: Wait for daily trend to turn bullish (EMA crossover)
⚠️ Disclaimer: This is educational analysis only, not financial advice.
Crypto markets are highly volatile.用户: "现在是ETH的好进场点吗?"
Agent操作:
- 运行命令:
python crypto_analyzer.py ETH/USDT all - 同时查看长期趋势和短期信号
- 给出平衡的评估结果
Agent回复:
ETH/USDT进场分析:
长期(日线):下跌趋势,价格低于关键EMA
短期(1小时):出现看涨背离,RSI超卖为28
信号:
✅ 短期RSI超卖 = 可能出现反弹
⚠️ 长期趋势仍为下跌
⚠️ 价格低于200 EMA
评估:长期进场风险较高,但若设置严格止损可以尝试短期反弹交易。
更安全的进场时机:等待日线趋势转涨(EMA交叉)
⚠️ 免责声明:本内容仅为教育类分析,不构成投资建议。加密货币市场波动性极高。Example 3: Risk Assessment
示例3:风险评估
User: "Should I be worried about my BTC position?"
Agent Actions:
- Run comprehensive analysis
- Check for warning signals
- Provide risk assessment
Agent Response:
Risk Assessment for BTC/USDT:
⚠️ WARNING SIGNALS DETECTED:
1. Daily RSI: 72 (overbought) - Price may face pullback pressure
2. 4h StochRSI: 87 (extremely overbought)
3. Price position: Near Bollinger Band upper limit
4. Potential bearish divergence forming
Risk Level: MEDIUM-HIGH for short-term pullback
Recommendations:
- Consider taking partial profits if in profit
- Set stop-loss at recent support level
- Watch for RSI to drop below 70 as confirmation of reversal
- Don't chase if price continues up (let it cool down first)
Long-term trend is still bullish, so this may be temporary correction.用户: "我持有的BTC头寸需要担心吗?"
Agent操作:
- 运行全量分析
- 检查预警信号
- 提供风险评估
Agent回复:
BTC/USDT风险评估:
⚠️ 检测到预警信号:
1. 日线RSI:72(超买) - 价格可能面临回调压力
2. 4小时StochRSI:87(极度超买)
3. 价格位置:接近Bollinger Bands上轨
4. 正在形成潜在看跌背离
风险等级:短期回调风险为中高
建议:
- 若已盈利可考虑部分止盈
- 在近期支撑位设置止损
- 等待RSI跌破70作为反转确认信号
- 若价格继续上涨不要追高(先等待回调)
长期趋势仍为上涨,因此本次可能是暂时回调。Troubleshooting
故障排查
Issue: Connection Error to Binance API
问题:Binance API连接错误
Possible Causes:
- Network connectivity issues
- Binance API temporarily down
- Rate limiting (too many requests)
Solutions:
- Check internet connection
- Wait a few minutes and retry
- Verify Binance API status at https://www.binance.com/en/support
可能原因:
- 网络连接问题
- Binance API临时故障
- 触发速率限制(请求过于频繁)
解决方案:
- 检查网络连接
- 等待几分钟后重试
- 查看Binance API状态:https://www.binance.com/en/support
Issue: Symbol Not Found
问题:未找到交易对
Problem: "Failed to fetch BTC/USDT data"
Solution:
- Ensure correct symbol format: (not BTCUSDT)
BTC/USDT - Check if symbol exists on Binance spot market
- Try different symbol (e.g., ETH/USDT)
报错信息: "Failed to fetch BTC/USDT data"
解决方案:
- 确认交易对格式正确:(不是BTCUSDT)
BTC/USDT - 确认该交易对在Binance现货市场存在
- 尝试其他交易对(如ETH/USDT)
Issue: Virtual Environment Not Activated
问题:未激活虚拟环境
Problem: "Module not found" errors
Solution:
bash
cd crypto-kline-analysis
source venv/bin/activate
python crypto_analyzer.py BTC/USDT报错信息: "Module not found"类错误
解决方案:
bash
cd crypto-kline-analysis
source venv/bin/activate
python crypto_analyzer.py BTC/USDTImportant Disclaimers
重要免责声明
For AI Agents: You MUST include these disclaimers in every analysis:
- ⚠️ Not Financial Advice: This analysis is for educational purposes only
- ⚠️ High Risk: Cryptocurrency trading carries significant risk of loss
- ⚠️ DYOR: Users should conduct their own research before trading
- ⚠️ No Guarantees: Past performance does not predict future results
- ⚠️ Volatility: Crypto markets are extremely volatile and unpredictable
面向AI Agent:你必须在每份分析中附带以下免责声明:
- ⚠️ 不构成投资建议:本分析仅用于教育目的
- ⚠️ 高风险提示:加密货币交易存在极高的损失风险
- ⚠️ DYOR:用户交易前应自行做好研究
- ⚠️ 无收益保证:历史表现不代表未来收益
- ⚠️ 波动性提示:加密货币市场波动性极强,走势不可预测
Technical Support
技术支持
- GitHub Issues: Report bugs or request features
- Documentation: See README.md for detailed setup
- Binance API Docs: https://binance-docs.github.io/apidocs/spot/en/
- GitHub Issues:提交bug或功能需求
- 文档:查看README.md获取详细搭建指南
- Binance API文档:https://binance-docs.github.io/apidocs/spot/en/
License
许可证
MIT License - See LICENSE file for details
MIT许可证 - 详见LICENSE文件