{"record":{"id":"7054201fd35a3025","repo":"TauricResearch/TradingAgents","slug":"indicator-indicator-is-not-supported-please-cho","errorCode":null,"errorMessage":"Indicator {indicator} is not supported. Please choose from: {list(supported_indicators.keys())}","messagePattern":"Indicator (.+?) is not supported\\. Please choose from: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tradingagents/dataflows/alpha_vantage_indicator.py","lineNumber":63,"sourceCode":"    }\n\n    indicator_descriptions = {\n        \"close_50_sma\": \"50 SMA: A medium-term trend indicator. Usage: Identify trend direction and serve as dynamic support/resistance. Tips: It lags price; combine with faster indicators for timely signals.\",\n        \"close_200_sma\": \"200 SMA: A long-term trend benchmark. Usage: Confirm overall market trend and identify golden/death cross setups. Tips: It reacts slowly; best for strategic trend confirmation rather than frequent trading entries.\",\n        \"close_10_ema\": \"10 EMA: A responsive short-term average. Usage: Capture quick shifts in momentum and potential entry points. Tips: Prone to noise in choppy markets; use alongside longer averages for filtering false signals.\",\n        \"macd\": \"MACD: Computes momentum via differences of EMAs. Usage: Look for crossovers and divergence as signals of trend changes. Tips: Confirm with other indicators in low-volatility or sideways markets.\",\n        \"macds\": \"MACD Signal: An EMA smoothing of the MACD line. Usage: Use crossovers with the MACD line to trigger trades. Tips: Should be part of a broader strategy to avoid false positives.\",\n        \"macdh\": \"MACD Histogram: Shows the gap between the MACD line and its signal. Usage: Visualize momentum strength and spot divergence early. Tips: Can be volatile; complement with additional filters in fast-moving markets.\",\n        \"rsi\": \"RSI: Measures momentum to flag overbought/oversold conditions. Usage: Apply 70/30 thresholds and watch for divergence to signal reversals. Tips: In strong trends, RSI may remain extreme; always cross-check with trend analysis.\",\n        \"boll\": \"Bollinger Middle: A 20 SMA serving as the basis for Bollinger Bands. Usage: Acts as a dynamic benchmark for price movement. Tips: Combine with the upper and lower bands to effectively spot breakouts or reversals.\",\n        \"boll_ub\": \"Bollinger Upper Band: Typically 2 standard deviations above the middle line. Usage: Signals potential overbought conditions and breakout zones. Tips: Confirm signals with other tools; prices may ride the band in strong trends.\",\n        \"boll_lb\": \"Bollinger Lower Band: Typically 2 standard deviations below the middle line. Usage: Indicates potential oversold conditions. Tips: Use additional analysis to avoid false reversal signals.\",\n        \"atr\": \"ATR: Averages true range to measure volatility. Usage: Set stop-loss levels and adjust position sizes based on current market volatility. Tips: It's a reactive measure, so use it as part of a broader risk management strategy.\",\n        \"vwma\": \"VWMA: A moving average weighted by volume. Usage: Confirm trends by integrating price action with volume data. Tips: Watch for skewed results from volume spikes; use in combination with other volume analyses.\"\n    }\n\n    if indicator not in supported_indicators:\n        raise ValueError(\n            f\"Indicator {indicator} is not supported. Please choose from: {list(supported_indicators.keys())}\"\n        )\n\n    curr_date_dt = datetime.strptime(curr_date, \"%Y-%m-%d\")\n    before = curr_date_dt - relativedelta(days=look_back_days)\n\n    # Get the full data for the period instead of making individual calls\n    _, required_series_type = supported_indicators[indicator]\n\n    # Use the provided series_type or fall back to the required one\n    if required_series_type:\n        series_type = required_series_type\n\n    try:\n        # Get indicator data for the period\n        if indicator == \"close_50_sma\":\n            data = _make_api_request(\"SMA\", {\n                \"symbol\": symbol,","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/TauricResearch/TradingAgents/blob/a33fd4c0f134485a43553a2c23a63cb14adbd88f/tradingagents/dataflows/alpha_vantage_indicator.py#L45-L81","documentation":"Raised by the Alpha Vantage indicator utility in tradingagents/dataflows/alpha_vantage_indicator.py when the requested indicator name is not in its supported_indicators dict (close, ema, sma, rsi, macd, macds, macdh, boll, boll_ub, boll_lb, atr, vwma, ...). It is a ValueError that lists the accepted keys, so callers know exactly what is available.","triggerScenarios":"Calling get_stock_data_indicators_adjusted (or the equivalent vendor method) with names like 'bollinger', 'moving_average', 'RSI ' (case/space variants), 'obv', 'stoch' — anything not a literal key of supported_indicators.","commonSituations":"LLM analysts passing natural-language indicator names; code ported from another library (TA-lib/pandas-ta) whose names differ; typos and casing mismatches; expecting an indicator that simply is not implemented for the Alpha Vantage vendor (try the stockstats vendor for a wider set).","solutions":["Use one of the exact keys from the error message (e.g. 'boll_ub' not 'bollinger_upper'; lowercase, no spaces)","Print the supported list first: the message itself contains list(supported_indicators.keys()) — code against that","If you need indicators like 'obv'/'stoch', switch the tool_vendors entry for that method to the stockstats implementation, which supports the wider stockstats set","Sanitize LLM/tool input by mapping synonyms to canonical keys before calling"],"exampleFix":"# before\nget_stock_data_indicators_adjusted(\"AAPL\", \"2025-06-10\", 10, \"bollinger_upper\")\n# -> ValueError: Indicator bollinger_upper is not supported. Please choose from: ['close', 'ema', ..., 'boll_ub', ...]\n\n# after\nget_stock_data_indicators_adjusted(\"AAPL\", \"2025-06-10\", 10, \"boll_ub\")","handlingStrategy":"validation","validationCode":"# Accept exactly what the vendor supports\nSUPPORTED = {\"close\", \"ema\", \"sma\", \"rsi\", \"macd\", \"macds\", \"macdh\", \"boll\", \"boll_ub\", \"boll_lb\", \"atr\", \"vwma\"}\nSYNONYMS = {\"bollinger_upper\": \"boll_ub\", \"bollinger_lower\": \"boll_lb\", \"bollinger\": \"boll\", \"signal\": \"macds\", \"histogram\": \"macdh\"}\n\ndef canonical_indicator(name: str) -> str:\n    n = name.strip().lower()\n    return SYNONYMS.get(n, n) if SYNONYMS.get(n, n) in SUPPORTED else None","typeGuard":"def is_supported_indicator(name: str) -> bool:\n    return isinstance(name, str) and name.strip().lower() in SUPPORTED","tryCatchPattern":"try:\n    get_stock_data_indicators_adjusted(sym, date, days, indicator)\nexcept ValueError as e:\n    if \"not supported\" in str(e):\n        indicator = \"boll_ub\"  # or re-prompt the LLM with the supported list\n    else:\n        raise","preventionTips":["Enumerate valid indicator keys in the tool description given to LLMs","Map synonyms to canonical keys in one normalization function at ingress","If you need a wider indicator set, route that tool to the stockstats vendor instead"],"tags":["validation","indicators","alpha-vantage","valueerror"],"backgroundTag":null,"analyzedSha":"a33fd4c0f134485a43553a2c23a63cb14adbd88f","analyzedAt":"2026-08-14T19:45:16.920Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}