INNER CODE UNIT · Python

get_moving_averages

Spoofkapoof/TradingViewMCPServer · tradingview_mcp/server.py:544

def get_moving_averages(symbol: str, timeframe: str = "1h") -> dict:
    """
    Calculate multiple moving averages (20, 50, 100, 200 period SMA/EMA).

    Args:
        symbol: Symbol (e.g., 'EURUSD', 'AAPL', 'BTC')
        timeframe: Time interval ('5m', '15m', '1h', '4h', '1d')

    Returns:
        SMAs and EMAs for 20, 50, 100, 200 periods and current price
    """
    hist_data = get_historical_data(symbol, timeframe)

    if not hist_data.get("success"):
        return hist_data

    mas = calculate_moving_averages(hist_data["data"])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…