{"record":{"id":"2f4f33753d8b999d","repo":"TauricResearch/TradingAgents","slug":"indicator-indicator-is-not-supported-please-cho-2f4f33","errorCode":null,"errorMessage":"Indicator {indicator} is not supported. Please choose from: {list(best_ind_params.keys())}","messagePattern":"Indicator (.+?) is not supported\\. Please choose from: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tradingagents/dataflows/y_finance.py","lineNumber":155,"sourceCode":"            \"ATR: Averages true range to measure volatility. \"\n            \"Usage: Set stop-loss levels and adjust position sizes based on current market volatility. \"\n            \"Tips: It's a reactive measure, so use it as part of a broader risk management strategy.\"\n        ),\n        # Volume-Based Indicators\n        \"vwma\": (\n            \"VWMA: A moving average weighted by volume. \"\n            \"Usage: Confirm trends by integrating price action with volume data. \"\n            \"Tips: Watch for skewed results from volume spikes; use in combination with other volume analyses.\"\n        ),\n        \"mfi\": (\n            \"MFI: The Money Flow Index is a momentum indicator that uses both price and volume to measure buying and selling pressure. \"\n            \"Usage: Identify overbought (>80) or oversold (<20) conditions and confirm the strength of trends or reversals. \"\n            \"Tips: Use alongside RSI or MACD to confirm signals; divergence between price and MFI can indicate potential reversals.\"\n        ),\n    }\n\n    if indicator not in best_ind_params:\n        raise ValueError(\n            f\"Indicator {indicator} is not supported. Please choose from: {list(best_ind_params.keys())}\"\n        )\n\n    end_date = curr_date\n    curr_date_dt = datetime.strptime(curr_date, \"%Y-%m-%d\")\n    before = curr_date_dt - relativedelta(days=look_back_days)\n\n    # Optimized: Get stock data once and calculate indicators for all dates\n    try:\n        indicator_data = _get_stock_stats_bulk(symbol, indicator, curr_date)\n\n        # Generate the date range we need\n        current_dt = curr_date_dt\n        date_values = []\n\n        while current_dt >= before:\n            date_str = current_dt.strftime('%Y-%m-%d')\n","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/TauricResearch/TradingAgents/blob/a33fd4c0f134485a43553a2c23a63cb14adbd88f/tradingagents/dataflows/y_finance.py#L137-L173","documentation":"ValueError raised in get_stock_stats_info_indicators_window (y_finance.py) when the requested technical indicator name is not a key of the best_ind_params dict. The library supports a fixed indicator set, and the error message lists exactly which names are accepted. Any other indicator string fails fast before any data fetch.","triggerScenarios":"Calling the indicator helper with indicator='ADX' (or any name not in the supported map) — the membership check `if indicator not in best_ind_params` fires immediately. Supported names include keys like 'ema', 'sma', 'rsi', 'macd', 'boll', 'vwma', 'mfi', etc.","commonSituations":"Passing an indicator abbreviation that differs from the library's naming (e.g. 'BOLL' vs 'boll', 'bb' vs 'boll'), assuming an indicator is supported because TradingView/pandas-ta has it, or forwarding free-text from an LLM/user without normalizing case.","solutions":["Lowercase and match the indicator name against the keys listed in the error message.","Inspect tradingagents.dataflows.y_finance best_ind_params to get the authoritative supported list.","Add a mapping layer in your code that translates your indicator aliases to the supported names before calling."],"exampleFix":"# before\nget_stock_stats_info_indicators_window('NVDA', '2024-06-01', 'BBANDS', 30)\n\n# after\nindicator = 'bbands'.lower()\nsupported = {'ema','sma','rsi','macd','boll','vwma','mfi'}\nassert indicator in supported, f'unsupported: {indicator}'\nget_stock_stats_info_indicators_window('NVDA', '2024-06-01', indicator, 30)","handlingStrategy":"validation","validationCode":"from tradingagents.dataflows.y_finance import best_ind_params\n\ndef normalize_indicator(name: str) -> str:\n    key = name.strip().lower()\n    if key not in best_ind_params:\n        raise ValueError(f'{name!r} not supported; choose from {sorted(best_ind_params)}')\n    return key","typeGuard":null,"tryCatchPattern":"try:\n    report = get_stock_stats_info_indicators_window(symbol, date, indicator, lookback)\nexcept ValueError as e:\n    if 'not supported' in str(e):\n        indicator = 'ema'  # or drop the indicator from the request\n    else:\n        raise","preventionTips":["Expose the supported indicator list to your UI/CLI so users pick from a menu.","Lowercase indicator input before calling.","Pin the library version so the supported set doesn't change under you."],"tags":["validation","indicators","yfinance","input-validation"],"backgroundTag":null,"analyzedSha":"a33fd4c0f134485a43553a2c23a63cb14adbd88f","analyzedAt":"2026-08-14T19:45:16.920Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}