{"record":{"id":"1a4637bbd90ee997","repo":"TauricResearch/TradingAgents","slug":"no-ohlcv-data-available-for-symbol","errorCode":null,"errorMessage":"No OHLCV data available for {symbol}.","messagePattern":"No OHLCV data available for (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"tradingagents/dataflows/market_data_validator.py","lineNumber":37,"sourceCode":"\n# A fixed, common indicator set so the snapshot is the same shape every run.\nDEFAULT_SNAPSHOT_INDICATORS: tuple[str, ...] = (\n    \"close_10_ema\", \"close_50_sma\", \"close_200_sma\",\n    \"rsi\", \"boll\", \"boll_ub\", \"boll_lb\",\n    \"macd\", \"macds\", \"macdh\", \"atr\",\n)\n\n\ndef _verified_rows(symbol: str, curr_date: str) -> pd.DataFrame:\n    \"\"\"OHLCV on or before curr_date, date-sorted. Raises if nothing usable.\n\n    ``load_ohlcv`` already normalizes the Date column and filters out\n    look-ahead rows, but we re-apply the cutoff defensively — this is a\n    verification path, so it must not trust its input to be pre-filtered.\n    \"\"\"\n    data = load_ohlcv(symbol, curr_date)\n    if data is None or data.empty:\n        raise ValueError(f\"No OHLCV data available for {symbol}.\")\n\n    df = data.copy()\n    df[\"Date\"] = pd.to_datetime(df[\"Date\"], errors=\"coerce\")\n    df = df.dropna(subset=[\"Date\"])\n    df = df[df[\"Date\"] <= pd.to_datetime(curr_date)].sort_values(\"Date\")\n    if df.empty:\n        raise ValueError(f\"No OHLCV rows on or before {curr_date} for {symbol}.\")\n    return df\n\n\ndef _fmt(value) -> str:\n    if value is None or pd.isna(value):\n        return \"N/A\"\n    if isinstance(value, pd.Timestamp):\n        return value.strftime(\"%Y-%m-%d\")\n    if isinstance(value, bool):\n        return str(value)\n    if isinstance(value, (int,)):","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/TauricResearch/TradingAgents/blob/a33fd4c0f134485a43553a2c23a63cb14adbd88f/tradingagents/dataflows/market_data_validator.py#L19-L55","documentation":"Raised by _verified_rows() in tradingagents/dataflows/market_data_validator.py when load_ohlcv() returns None or an empty frame for the symbol — there is no cached or fetchable OHLCV data at all. It is a ValueError from the post-hoc verification path that double-checks analyst numbers against real price data.","triggerScenarios":"Validating a claim for a ticker whose cache file was never populated and whose fetch failed, an invalid/delisted ticker, or a symbol that the data vendor simply does not cover (some OTC/foreign symbols). load_ohlcv returning an empty DataFrame triggers this exact branch.","commonSituations":"LLM hallucinating an obscure ticker; delisted symbols in backtests; restricted vendor coverage for the symbol; cache directory wiped between the data step and verification.","solutions":["Confirm the symbol is valid and currently trading (delisted tickers won't have data)","Warm the cache first by fetching prices for the symbol (get_historical_prices) before running validation, and check the cache file appears under the traderai data dir","Configure a wider vendor chain (data_vendors=\"yfinance,alpha_vantage\") so coverage gaps fall through","Catch ValueError in the verification caller and report 'cannot verify — no data' instead of aborting"],"exampleFix":"# before\nrows = _verified_rows(\"ZZZZZZ\", \"2025-06-10\")  # invalid/uncovered ticker\n# -> ValueError: No OHLCV data available for ZZZZZZ.\n\n# after\ntry:\n    rows = _verified_rows(symbol, curr_date)\nexcept ValueError:\n    verdict = f\"Cannot verify {symbol}: no OHLCV data available\"  # graceful degradation","handlingStrategy":"try-catch","validationCode":"from tradingagents.dataflows.stockstats_utils import load_ohlcv\n\ndef has_ohlcv(symbol: str, curr_date: str) -> bool:\n    data = load_ohlcv(symbol, curr_date)\n    return data is not None and not data.empty","typeGuard":null,"tryCatchPattern":"try:\n    rows = _verified_rows(symbol, curr_date)\nexcept ValueError as e:\n    if \"No OHLCV data available\" in str(e):\n        return f\"Cannot verify {symbol}: no market data — report as unverifiable\"\n    raise","preventionTips":["Warm/verify symbol data with a cheap price fetch before running the analyst pipeline","Filter symbol universes to listed, covered tickers before backtests","Treat missing data as a verdict (report unverifiable), never as a reason to guess numbers"],"tags":["data-quality","ohlcv","validation","symbols"],"backgroundTag":null,"analyzedSha":"a33fd4c0f134485a43553a2c23a63cb14adbd88f","analyzedAt":"2026-08-14T19:45:16.920Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}