TauricResearch/TradingAgents · error · ValueError

Indicator is not supported. Please choose from

Error message

Indicator {indicator} is not supported. Please choose from: {list(best_ind_params.keys())}

What it means

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.

Solutions

  1. Lowercase and match the indicator name against the keys listed in the error message.
  2. Inspect tradingagents.dataflows.y_finance best_ind_params to get the authoritative supported list.
  3. Add a mapping layer in your code that translates your indicator aliases to the supported names before calling.

Example fix

# before
get_stock_stats_info_indicators_window('NVDA', '2024-06-01', 'BBANDS', 30)

# after
indicator = 'bbands'.lower()
supported = {'ema','sma','rsi','macd','boll','vwma','mfi'}
assert indicator in supported, f'unsupported: {indicator}'
get_stock_stats_info_indicators_window('NVDA', '2024-06-01', indicator, 30)
Defensive patterns

Strategy: validation

Validate before calling

from tradingagents.dataflows.y_finance import best_ind_params

def normalize_indicator(name: str) -> str:
    key = name.strip().lower()
    if key not in best_ind_params:
        raise ValueError(f'{name!r} not supported; choose from {sorted(best_ind_params)}')
    return key

Try / catch

try:
    report = get_stock_stats_info_indicators_window(symbol, date, indicator, lookback)
except ValueError as e:
    if 'not supported' in str(e):
        indicator = 'ema'  # or drop the indicator from the request
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of TauricResearch/TradingAgents@a33fd4c0f1 (2026-08-14). Data as JSON: /api/errors/2f4f33753d8b999d. Report an issue: GitHub.

Appendix: source

Thrown at tradingagents/dataflows/y_finance.py:155

            "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."
        ),
        # Volume-Based Indicators
        "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."
        ),
        "mfi": (
            "MFI: The Money Flow Index is a momentum indicator that uses both price and volume to measure buying and selling pressure. "
            "Usage: Identify overbought (>80) or oversold (<20) conditions and confirm the strength of trends or reversals. "
            "Tips: Use alongside RSI or MACD to confirm signals; divergence between price and MFI can indicate potential reversals."
        ),
    }

    if indicator not in best_ind_params:
        raise ValueError(
            f"Indicator {indicator} is not supported. Please choose from: {list(best_ind_params.keys())}"
        )

    end_date = curr_date
    curr_date_dt = datetime.strptime(curr_date, "%Y-%m-%d")
    before = curr_date_dt - relativedelta(days=look_back_days)

    # Optimized: Get stock data once and calculate indicators for all dates
    try:
        indicator_data = _get_stock_stats_bulk(symbol, indicator, curr_date)

        # Generate the date range we need
        current_dt = curr_date_dt
        date_values = []

        while current_dt >= before:
            date_str = current_dt.strftime('%Y-%m-%d')

View on GitHub (pinned to a33fd4c0f1)