volume_confirmation_analysis
Analyze volume confirmation patterns for cryptocurrency trades to validate price movements and identify potential entry/exit signals using specified timeframes and exchanges.
Instructions
Detailed volume confirmation analysis for a specific coin.
Args:
symbol: Coin symbol (e.g., BTCUSDT)
exchange: Exchange name
timeframe: Time frame for analysis
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exchange | No | KUCOIN | |
| symbol | Yes | ||
| timeframe | No | 15m |
Implementation Reference
- src/tradingview_mcp/server.py:1096-1214 (handler)Handler function implementing the volume_confirmation_analysis tool logic, including volume ratio calculation, signal generation, and technical analysis integration. Registered via @mcp.tool() decorator.@mcp.tool() def volume_confirmation_analysis(symbol: str, exchange: str = "KUCOIN", timeframe: str = "15m") -> dict: """Detailed volume confirmation analysis for a specific coin. Args: symbol: Coin symbol (e.g., BTCUSDT) exchange: Exchange name timeframe: Time frame for analysis """ exchange = sanitize_exchange(exchange, "KUCOIN") timeframe = sanitize_timeframe(timeframe, "15m") if not symbol.upper().endswith('USDT'): symbol = symbol.upper() + 'USDT' screener = EXCHANGE_SCREENER.get(exchange, "crypto") try: analysis = get_multiple_analysis(screener=screener, interval=timeframe, symbols=[symbol]) if not analysis or symbol not in analysis: return {"error": f"No data found for {symbol}"} data = analysis[symbol] if not data or not hasattr(data, 'indicators'): return {"error": f"No indicator data for {symbol}"} indicators = data.indicators # Get volume data volume = indicators.get('volume', 0) close = indicators.get('close', 0) open_price = indicators.get('open', 0) high = indicators.get('high', 0) low = indicators.get('low', 0) # Calculate price metrics price_change = ((close - open_price) / open_price) * 100 if open_price > 0 else 0 candle_range = ((high - low) / low) * 100 if low > 0 else 0 # Volume analysis sma20_volume = indicators.get('volume.SMA20', 0) volume_ratio = volume / sma20_volume if sma20_volume > 0 else 1 # Technical indicators rsi = indicators.get('RSI', 50) bb_upper = indicators.get('BB.upper', 0) bb_lower = indicators.get('BB.lower', 0) bb_middle = (bb_upper + bb_lower) / 2 if bb_upper and bb_lower else close # Volume confirmation signals signals = [] # Strong volume + price breakout if volume_ratio >= 2.0 and abs(price_change) >= 3.0: signals.append(f"๐ STRONG BREAKOUT: {volume_ratio:.1f}x volume + {price_change:.1f}% price") # Volume divergence if volume_ratio >= 1.5 and abs(price_change) < 1.0: signals.append(f"โ ๏ธ VOLUME DIVERGENCE: High volume ({volume_ratio:.1f}x) but low price movement") # Low volume on price move (weak signal) if abs(price_change) >= 2.0 and volume_ratio < 0.8: signals.append(f"โ WEAK SIGNAL: Price moved but volume is low ({volume_ratio:.1f}x)") # Bollinger Band + Volume confirmation if close > bb_upper and volume_ratio >= 1.5: signals.append(f"๐ฅ BB BREAKOUT CONFIRMED: Upper band breakout + volume confirmation") elif close < bb_lower and volume_ratio >= 1.5: signals.append(f"๐ BB SELL CONFIRMED: Lower band breakout + volume confirmation") # RSI + Volume analysis if rsi > 70 and volume_ratio >= 2.0: signals.append(f"๐ฅ OVERBOUGHT + VOLUME: RSI {rsi:.1f} + {volume_ratio:.1f}x volume") elif rsi < 30 and volume_ratio >= 2.0: signals.append(f"๐ OVERSOLD + VOLUME: RSI {rsi:.1f} + {volume_ratio:.1f}x volume") # Overall assessment if volume_ratio >= 3.0: volume_strength = "VERY STRONG" elif volume_ratio >= 2.0: volume_strength = "STRONG" elif volume_ratio >= 1.5: volume_strength = "MEDIUM" elif volume_ratio >= 1.0: volume_strength = "NORMAL" else: volume_strength = "WEAK" return { "symbol": symbol, "price_data": { "close": close, "change_percent": round(price_change, 2), "candle_range_percent": round(candle_range, 2) }, "volume_analysis": { "current_volume": volume, "volume_ratio": round(volume_ratio, 2), "volume_strength": volume_strength, "average_volume": sma20_volume }, "technical_indicators": { "RSI": round(rsi, 1), "BB_position": "ABOVE" if close > bb_upper else "BELOW" if close < bb_lower else "WITHIN", "BB_upper": bb_upper, "BB_lower": bb_lower }, "signals": signals, "overall_assessment": { "bullish_signals": len([s for s in signals if "๐" in s or "๐ฅ" in s or "๐" in s]), "bearish_signals": len([s for s in signals if "๐" in s or "โ" in s]), "warning_signals": len([s for s in signals if "โ ๏ธ" in s]) } } except Exception as e: return {"error": f"Analysis failed: {str(e)}"}
- src/tradingview_mcp/server.py:1096-1096 (registration)Registration of the tool via FastMCP decorator.@mcp.tool()