Skip to main content
Glama
patch-ridermg48

TradingView MCP Server

smart_volume_scanner

Scan cryptocurrency markets for assets with significant volume spikes and technical analysis conditions like RSI levels and price changes to identify trading opportunities.

Instructions

Smart volume + technical analysis combination scanner.

Args:
	exchange: Exchange name
	min_volume_ratio: Minimum volume multiplier (default 2.0)
	min_price_change: Minimum price change percentage (default 2.0)
	rsi_range: "oversold" (<30), "overbought" (>70), "neutral" (30-70), "any"
	limit: Number of results (max 30)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeNoKUCOIN
min_volume_ratioNo
min_price_changeNo
rsi_rangeNoany
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for 'smart_volume_scanner' tool, including the @mcp.tool() registration decorator. Sanitizes inputs, calls volume_breakout_scanner for candidates, filters by RSI range, adds trading recommendations, and returns limited list of results.
    @mcp.tool()
    def smart_volume_scanner(exchange: str = "KUCOIN", min_volume_ratio: float = 2.0, min_price_change: float = 2.0, rsi_range: str = "any", limit: int = 20) -> list[dict]:
    	"""Smart volume + technical analysis combination scanner.
    	
    	Args:
    		exchange: Exchange name
    		min_volume_ratio: Minimum volume multiplier (default 2.0)
    		min_price_change: Minimum price change percentage (default 2.0)
    		rsi_range: "oversold" (<30), "overbought" (>70), "neutral" (30-70), "any"
    		limit: Number of results (max 30)
    	"""
    	exchange = sanitize_exchange(exchange, "KUCOIN")
    	min_volume_ratio = max(1.2, min(10.0, min_volume_ratio))
    	min_price_change = max(0.5, min(20.0, min_price_change))
    	limit = max(1, min(limit, 30))
    	
    	# Get volume breakouts first
    	volume_breakouts = volume_breakout_scanner(
    		exchange=exchange, 
    		volume_multiplier=min_volume_ratio,
    		price_change_min=min_price_change,
    		limit=limit * 2  # Get more to filter
    	)
    	
    	if not volume_breakouts:
    		return []
    	
    	# Apply RSI filter
    	filtered_results = []
    	for coin in volume_breakouts:
    		rsi = coin["indicators"].get("RSI", 50)
    		
    		if rsi_range == "oversold" and rsi >= 30:
    			continue
    		elif rsi_range == "overbought" and rsi <= 70:
    			continue
    		elif rsi_range == "neutral" and (rsi <= 30 or rsi >= 70):
    			continue
    		# "any" passes all
    		
    		# Add trading recommendation
    		recommendation = ""
    		if coin["changePercent"] > 0 and coin["volume_ratio"] >= 2.0:
    			if rsi < 70:
    				recommendation = "🚀 STRONG BUY"
    			else:
    				recommendation = "⚠️ OVERBOUGHT - CAUTION"
    		elif coin["changePercent"] < 0 and coin["volume_ratio"] >= 2.0:
    			if rsi > 30:
    				recommendation = "📉 STRONG SELL"
    			else:
    				recommendation = "🛒 OVERSOLD - OPPORTUNITY?"
    		
    		coin["trading_recommendation"] = recommendation
    		filtered_results.append(coin)
    	
    	return filtered_results[:limit]
  • Supporting helper tool 'volume_breakout_scanner' called by smart_volume_scanner to fetch initial volume breakout candidates for further filtering.
    @mcp.tool()
    def volume_breakout_scanner(exchange: str = "KUCOIN", timeframe: str = "15m", volume_multiplier: float = 2.0, price_change_min: float = 3.0, limit: int = 25) -> list[dict]:
    	"""Detect coins with volume breakout + price breakout.
    	
    	Args:
    		exchange: Exchange name like KUCOIN, BINANCE, BYBIT, etc.
    		timeframe: One of 5m, 15m, 1h, 4h, 1D, 1W, 1M
    		volume_multiplier: How many times the volume should be above normal level (default 2.0)
    		price_change_min: Minimum price change percentage (default 3.0)
    		limit: Number of rows to return (max 50)
    	"""
    	exchange = sanitize_exchange(exchange, "KUCOIN")
    	timeframe = sanitize_timeframe(timeframe, "15m")
    	volume_multiplier = max(1.5, min(10.0, volume_multiplier))
    	price_change_min = max(1.0, min(20.0, price_change_min))
    	limit = max(1, min(limit, 50))
    	
    	# Get symbols
    	symbols = load_symbols(exchange)
    	if not symbols:
    		return []
    	
    	screener = EXCHANGE_SCREENER.get(exchange, "crypto")
    	volume_breakouts = []
    	
    	# Process in batches
    	batch_size = 100
    	for i in range(0, min(len(symbols), 500), batch_size):  # Limit to 500 symbols for performance
    		batch_symbols = symbols[i:i + batch_size]
    		
    		try:
    			analysis = get_multiple_analysis(screener=screener, interval=timeframe, symbols=batch_symbols)
    		except Exception:
    			continue
    			
    		for symbol, data in analysis.items():
    			try:
    				if not data or not hasattr(data, 'indicators'):
    					continue
    					
    				indicators = data.indicators
    				
    				# Get required data
    				volume = indicators.get('volume', 0)
    				close = indicators.get('close', 0)
    				open_price = indicators.get('open', 0)
    				sma20_volume = indicators.get('volume.SMA20', 0)  # 20-period volume average
    				
    				if not all([volume, close, open_price]) or volume <= 0:
    					continue
    				
    				# Calculate price change %
    				price_change = ((close - open_price) / open_price) * 100 if open_price > 0 else 0
    				
    				# Volume ratio calculation
    				# If SMA20 volume not available, use a simple heuristic
    				if sma20_volume and sma20_volume > 0:
    					volume_ratio = volume / sma20_volume
    				else:
    					# Estimate average volume as current volume / 2 (conservative)
    					avg_volume_estimate = volume / 2
    					volume_ratio = volume / avg_volume_estimate if avg_volume_estimate > 0 else 1
    				
    				# Check conditions
    				if (abs(price_change) >= price_change_min and 
    					volume_ratio >= volume_multiplier):
    					
    					# Get additional indicators
    					rsi = indicators.get('RSI', 50)
    					bb_upper = indicators.get('BB.upper', 0)
    					bb_lower = indicators.get('BB.lower', 0)
    					
    					# Volume strength score
    					volume_strength = min(10, volume_ratio)  # Cap at 10x
    					
    					volume_breakouts.append({
    						"symbol": symbol,
    						"changePercent": price_change,
    						"volume_ratio": round(volume_ratio, 2),
    						"volume_strength": round(volume_strength, 1),
    						"current_volume": volume,
    						"breakout_type": "bullish" if price_change > 0 else "bearish",
    						"indicators": {
    							"close": close,
    							"RSI": rsi,
    							"BB_upper": bb_upper,
    							"BB_lower": bb_lower,
    							"volume": volume
    						}
    					})
    					
    			except Exception:
    				continue
    	
    	# Sort by volume strength first, then by price change
    	volume_breakouts.sort(key=lambda x: (x["volume_strength"], abs(x["changePercent"])), reverse=True)
    	
    	return volume_breakouts[:limit]
  • Utility function sanitize_exchange used in smart_volume_scanner to validate and normalize the exchange parameter.
    def sanitize_exchange(ex: str, default: str = "kucoin") -> str:
        if not ex:
            return default
        exs = ex.strip().lower()
        return exs if exs in EXCHANGE_SCREENER else default
  • Input schema defined by function parameters type hints, defaults, and docstring Args section. Output is list[dict].
    def smart_volume_scanner(exchange: str = "KUCOIN", min_volume_ratio: float = 2.0, min_price_change: float = 2.0, rsi_range: str = "any", limit: int = 20) -> list[dict]:
    	"""Smart volume + technical analysis combination scanner.
    	
    	Args:
    		exchange: Exchange name
    		min_volume_ratio: Minimum volume multiplier (default 2.0)
    		min_price_change: Minimum price change percentage (default 2.0)
    		rsi_range: "oversold" (<30), "overbought" (>70), "neutral" (30-70), "any"
    		limit: Number of results (max 30)
    	"""
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the tool as a 'scanner,' implying a read-only operation that returns filtered results, but doesn't specify whether it requires authentication, has rate limits, returns real-time or historical data, or what happens with invalid inputs. The description adds minimal behavioral context beyond the basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with a high-level purpose followed by detailed parameter explanations in a structured 'Args:' section. Every sentence earns its place by clarifying the tool's function or parameters. It could be slightly more concise by integrating defaults into the parameter descriptions more seamlessly, but overall it's efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters, 0% schema coverage, no annotations, but with an output schema), the description is reasonably complete. It fully documents all input parameters, which compensates for the lack of schema descriptions. Since an output schema exists, the description doesn't need to explain return values. However, it lacks behavioral context (e.g., error handling, data sources), which is a minor gap for a scanning tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate by explaining all parameters. It successfully documents all 5 parameters with clear semantics: 'exchange' (exchange name), 'min_volume_ratio' (minimum volume multiplier with default), 'min_price_change' (minimum price change percentage with default), 'rsi_range' (oversold/overbought/neutral/any categories), and 'limit' (number of results with max). This adds significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as a 'smart volume + technical analysis combination scanner,' which indicates it scans for trading opportunities using volume and RSI metrics. However, it doesn't explicitly differentiate itself from sibling tools like 'volume_breakout_scanner' or 'volume_confirmation_analysis,' which likely have overlapping functionality. The verb 'scanner' is specific, but the exact resource (e.g., stocks, cryptocurrencies) is implied rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling scanning tools available (e.g., 'volume_breakout_scanner,' 'bollinger_scan'), there's no indication of what scenarios favor this tool, what prerequisites exist, or when other tools might be more appropriate. Usage is implied through parameter descriptions but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/patch-ridermg48/tradingview-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server