TradingView MCP Server: Hermes Integration
Integrating TradingView MCP Server with Hermes Agent for automated technical analysis and trading insights.
TradingView MCP Server: Hermes Integration Complete Guide
Introduction
Model Context Protocol (MCP) adalah standar baru yang memungkinkan AI assistants seperti Rin untuk menggunakan external tools dan data sources secara seamless. Dengan MCP, Rin bisa mengakses real-time data dari TradingView untuk technical analysis langsung dari chat.
Key Benefits: - ✅ Real-time market data langsung dari TradingView - ✅ 21+ technical analysis tools available - ✅ Works via Telegram, Discord, CLI - ✅ No manual chart checking needed - ✅ Instant analysis reports
What is MCP?
Background
Traditional AI assistants limited karena tidak bisa akses real-time data. MCP solves this dengan membuat standardized interface antara AI dan external tools.
How It Works:
User Request → Hermes → MCP Server → TradingView API → Results → AI Analysis
Architecture: - MCP Client: Built into Hermes Agent - MCP Server: TradingView MCP (separate process) - Communication: JSON-RPC over stdio - Security: Local only, no external exposure
Supported Platforms
- ✅ Linux (Ubuntu/Debian)
- ✅ macOS (Intel/Apple Silicon)
- ❌ Windows (limited support)
Tools Available (21 Total)
Market Data Tools
1. market_snapshot
Purpose: Quick market overview dengan key metrics
Parameters:
- symbol: Trading pair (BTCUSDT, ETHUSDT, etc.)
- exchange: BINANCE, COINBASE, etc.
Returns: - Current price - 24h change (%) - Volume - Market cap - High/Low prices
Example:
User: "Snapshot BTC"
Rin: BTCUSDT @ $67,420 (+2.3% | 24h)
Volume: $32.5B | Market Cap: $1.3T
2. coin_analysis
Purpose: Deep technical analysis dengan multiple indicators
Parameters:
- symbol: Trading pair
- timeframe: 1m, 5m, 15m, 1h, 4h, 1d, 1w, 1M
- indicators: Array of indicators to calculate
Available Indicators: | Indicator | Type | Use Case | |-----------|------|----------| | SMA | Trend | Simple moving average | | EMA | Trend | Exponential moving average (more responsive) | | RSI | Momentum | Overbought (>70) / Oversold (<30) | | MACD | Momentum | Trend direction, momentum shifts | | Bollinger | Volatility | Entry/exit points, squeeze detection | | Stochastic | Momentum | Reversal signals | | ATR | Volatility | Stop loss placement | | VWAP | Volume | Intraday support/resistance | | Volume | Volume | Confirm trend strength |
Example Response:
ETH/USDT (1H Analysis):
━━━━━━━━━━━━━━━━━━━━━
Price: $3,245.50 (+1.8% 24h)
Bollinger Bands:
Upper: $3,380 (Strong resistance)
Middle: $3,210 (SMA 20)
Lower: $3,040 (Support)
Width: 10.5% (normal volatility)
Support/Resistance:
R2: $3,400 | R1: $3,320
S1: $3,180 | S2: $3,050
Signal: NEUTRAL (price at middle band)
3. backtest_strategy
Purpose: Test trading strategy pada historical data
Parameters:
- symbol: Trading pair
- strategy_name: RSI, EMA_CROSS, BB_SQUEEZE, etc.
- timeframe: Data granularity
- start_date: Backtest period start
- end_date: Backtest period end
- initial_capital: Starting capital untuk simulation
Strategy Types: 1. RSI Strategy: Buy <30, Sell >70 2. EMA Cross: Fast EMA crosses slow EMA 3. Bollinger Squeeze: Breakout dari consolidation 4. MACD Divergence: Trend reversal detection 5. VWAP Bounce: Institutional level trading
Example Output:
Backtest: RSI Strategy (BTC/USD)
Period: 2024-01-01 to 2024-03-01
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Initial Capital: $10,000
Final Capital: $11,450
Total Return: +14.5%
Trades: 12
Win Rate: 58.3% (7 wins, 5 losses)
Avg Win: $340
Avg Loss: $180
Profit Factor: 2.1
Max Drawdown: -8.2%
Sharpe Ratio: 1.4
Conclusion: Strategy profitable but requires discipline.
Sentiment Analysis Tools
4. market_sentiment
Purpose: Analyze Reddit sentiment untuk crypto discussions
Parameters:
- symbol: BTC, ETH, etc.
- subreddits: r/CryptoCurrency, r/Bitcoin, etc.
- time_window: 1h, 24h, 7d
Metrics: - Sentiment score (-1 to +1) - Mention count - Trending keywords - Fear & Greed index correlation
Example:
BTC Reddit Sentiment (24h):
━━━━━━━━━━━━━━━━━━━━━━
Sentiment: +0.42 (Bullish)
Mentions: 2,847 (↑ 15% vs 24h ago)
Top Keywords:
1. "halving" (312 mentions)
2. "ETF" (287 mentions)
3. "institutional" (156 mentions)
Key Threads:
• "Why I'm bullish post-halving" (892 upvotes)
• "MicroStrategy buys more" (756 upvotes)
Conclusion: Positive sentiment, strong retail interest.
5. combined_analysis ⭐ POWER TOOL
Purpose: Ultimate analysis combining TA + Sentiment + On-chain
Best untuk: Quick decision making dengan complete picture
Includes: - Technical analysis (all indicators) - Market sentiment - Social media trends - Volume profile - Support/Resistance levels - Trend classification - Trading recommendation
Example Report:
🎯 COMBINED ANALYSIS: SOL/USDT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 TECHNICAL (4H)
Price: $142.50 (+5.2% 24h)
Trend: STRONG UPTREND
RSI: 68 (approaching overbought)
MACD: Bullish crossover
Bollinger: Upper band touched
💭 SENTIMENT (24h)
Reddit: +0.58 (Very Bullish)
Twitter: +0.42 (Bullish)
Fear & Greed: 78 (Extreme Greed)
📈 ON-CHAIN
Network Activity: ↑ 23%
Active Addresses: ↑ 18%
Whale Transfers: 12 (>$1M)
🎯 SUPPORT/RESISTANCE
R2: $155 | R1: $148 (current battle)
S1: $138 | S2: $132
⚡ RECOMMENDATION
Short-term: CAUTIOUS (overbought signals)
Entry Zone: $138-142 (S1 area)
Stop Loss: $134 (below S2)
Target 1: $150 (+5%)
Target 2: $158 (+11%)
Risk/Reward: 1:2.5 ✅
Specialized Tools
6. smart_volume_scanner
Purpose: Detect unusual volume activity (whale movements)
Alerts untuk: - Volume spike >200% of average - Large single transactions - Accumulation/distribution patterns
7. trend_classifier
Purpose: Identify market regime (trending vs ranging)
Classifications: - STRONG UPTREND - WEAK UPTREND - CONSOLIDATION - WEAK DOWNTREND - STRONG DOWNTREND
8. support_resistance
Purpose: Calculate precise S/R levels dengan volume profile
Integration Steps (Complete Setup)
Step 1: Install TradingView MCP Server
# Method 1: Via pip (recommended)
pip3 install tradingview-mcp
# Method 2: From source
git clone https://github.com/yourusername/tradingview-mcp.git
cd tradingview-mcp
pip3 install -e .
# Verify installation
which tradingview-mcp
# Should show: /home/user/.local/bin/tradingview-mcp
Requirements: - Python 3.8+ - pip3 - Internet connection - TradingView account (free tier works)
Step 2: Configure Hermes
Edit ~/.hermes/config.yaml:
# MCP Servers Configuration
mcp_servers:
tradingview:
command: "/home/user/.local/bin/tradingview-mcp"
args: []
env:
TV_API_KEY: "your_api_key_here" # Optional, for premium
enabled: true
timeout: 30
# Tool filtering (whitelist approach)
tools:
include:
- market_snapshot
- coin_analysis
- backtest_strategy
- market_sentiment
- combined_analysis
- smart_volume_scanner
- trend_classifier
- support_resistance
# exclude: [] # Use include OR exclude, not both
# Rate limiting
rate_limits:
requests_per_minute: 60
burst_size: 10
# Enable MCP globally
mcp:
enabled: true
default_servers:
- tradingview
Step 3: Test Configuration
# Start Hermes CLI
hermes
# Test MCP connection
/mcp test tradingview
# Expected output:
# ✅ MCP server 'tradingview' connected
# ✅ 21 tools available
# ✅ Response time: 245ms
Step 4: Usage Examples
Example 1: Quick Market Check
User: "Analisa BTC timeframe 4h"
Rin: [MCP Request → coin_analysis(BTCUSDT, 4h)]
Analisis Teknikal BTC/USDT (4H)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Price: $67,420 (+2.3% | 24h)
Bollinger Bands:
• Upper: $68,500 (Resistance)
• Middle: $66,200 (SMA 20)
• Lower: $63,900 (Support)
Signal: BULLISH (price above middle band)
Recommendation: Hold / Cautious buy
Stop Loss: $65,800
Target: $69,500
Example 2: Strategy Backtest
User: "Backtest RSI strategy untuk ETH 1h timeframe"
Rin: [MCP Request → backtest_strategy(ETHUSDT, RSI, 1h)]
BACKTEST RESULTS: RSI Strategy
ETH/USDT | 1H Timeframe
━━━━━━━━━━━━━━━━━━━━━━━━━
Period: Last 90 days
Total Trades: 24
Win Rate: 62.5%
Profit: +18.3%
Max Drawdown: -12.1%
Conclusion: Strategy viable untuk ETH
dengan proper risk management.
Example 3: Sentiment Check
User: "Sentiment BTC di Reddit?"
Rin: [MCP Request → market_sentiment(BTC)]
BTC Reddit Sentiment Analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━
Overall: +0.47 (Bullish) 🟢
Hot Topics:
• Halving countdown (892 mentions)
• ETF inflows (634 mentions)
• Technical breakout (445 mentions)
Trend: Increasing positive sentiment
vs 7-day average: +23%
Example 4: Complete Analysis
User: "Full analysis SOL dengan semua indikator"
Rin: [MCP Request → combined_analysis(SOLUSDT, 4h)]
🎯 COMPREHENSIVE ANALYSIS: SOL/USDT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Technical, Sentiment, On-chain data...]
[See example di atas untuk format lengkap]
Advanced Usage
Custom Indicators Combination
Request specific indicators:
"Analisa BTC dengan RSI, MACD, dan Bollinger"
Rin akan focus pada 3 indikator tersebut,
provide deeper analysis untuk each.
Multi-Timeframe Analysis
"Analisa BTC 4h untuk trend, 1h untuk entry"
Rin:
4H Trend: Uptrend intact
1H Entry: Wait for pullback to $66,500
Comparative Analysis
"Bandingkan ETH vs BTC technical setup"
Rin: Compare metrics side-by-side:
• Trend strength
• RSI levels
• Volume profile
• Support/Resistance quality
Troubleshooting
Issue: "MCP server not found"
Solution:
# Check if installed
which tradingview-mcp
# If not found, reinstall
pip3 install --force-reinstall tradingview-mcp
# Add to PATH if needed
export PATH="$PATH:$HOME/.local/bin"
echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bashrc
Issue: "API rate limit exceeded"
Solution:
# Add rate limiting ke config
mcp_servers:
tradingview:
rate_limits:
requests_per_minute: 30 # Reduce dari default 60
cooldown_seconds: 2
Issue: "Timeout errors"
Solution:
# Increase timeout
mcp_servers:
tradingview:
timeout: 60 # Increase dari 30
Issue: "Tools not available"
Solution:
# Check server status
hermes /mcp status
# Restart MCP server
hermes /mcp restart tradingview
# Verify tools list
hermes /mcp tools tradingview
Best Practices
1. Combine dengan Fundamental Analysis
User: "Analisa BTC technical + fundamental"
Rin: Gunakan MCP untuk technical,
kemudian web search untuk news/fundamental.
Combine untuk complete picture.
2. Set Alert Thresholds
User: "Alert kalau BTC RSI turun below 30"
Rin: Setup cron job untuk check setiap jam.
Send notification via Telegram.
3. Track Analysis Accuracy
User: "Track berapa akurat analisis Rin"
Rin: Log setiap prediction dengan timestamp.
Review weekly untuk improve accuracy.
4. Use Multiple Timeframes
Always check:
- 1W/1D: Long-term trend
- 4H/1H: Medium-term setup
- 15m/5m: Entry/exit timing
Limitations & Disclaimers
⚠️ Important
- Not Financial Advice: All analysis untuk educational purposes
- Past Performance: Backtest results don't guarantee future performance
- Market Risk: Crypto highly volatile, only risk what you can afford to lose
- Technical Analysis: Works best dalam trending markets, less effective saat choppy/ranging
Limitations
- Data delayed by 1-5 minutes (not true real-time)
- Historical data limited untuk some altcoins
- Sentiment analysis based on sample, not comprehensive
- Whales can manipulate technical patterns
Conclusion
TradingView MCP integration membuat Rin menjadi complete crypto research assistant:
Before MCP: - ❌ Could only answer based on training data - ❌ No access to real-time prices - ❌ No technical analysis capability
After MCP: - ✅ Real-time market data - ✅ Professional-grade technical analysis - ✅ Backtesting capabilities - ✅ Sentiment analysis - ✅ Integrated dalam chat interface
Integration Status: ✅ COMPLETE & OPERATIONAL
Mas sekarang bisa dapatkan analysis dalam seconds tanpa perlu manual chart checking. Perfect untuk quick decision making dan staying updated dengan market movements! 📈✨
Next Steps: 1. Test dengan simple request: "Analisa BTC" 2. Explore different timeframes 3. Setup alerts untuk key levels 4. Track performance dari analysis
Happy trading! 🚀