INNER CODE UNIT · Python
get_vwap
Spoofkapoof/TradingViewMCPServer · tradingview_mcp/server.py:822
def get_vwap(symbol: str, timeframe: str = "1h") -> dict:
"""
Calculate VWAP (Volume Weighted Average Price).
Args:
symbol: Symbol (e.g., 'EURUSD', 'AAPL', 'BTC')
timeframe: Time interval ('5m', '15m', '1h', '4h', '1d')
Returns:
VWAP value and current price comparison
"""
hist_data = get_historical_data(symbol, timeframe)
if not hist_data.get("success"):
return hist_data
vwap = calculate_vwap(hist_data["data"])