TauricResearch/TradingAgents · warning · ValueError
No OHLCV data available for {symbol}.
Error message
No OHLCV data available for {symbol}. What it means
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.
Source
Thrown at tradingagents/dataflows/market_data_validator.py:37
# A fixed, common indicator set so the snapshot is the same shape every run.
DEFAULT_SNAPSHOT_INDICATORS: tuple[str, ...] = (
"close_10_ema", "close_50_sma", "close_200_sma",
"rsi", "boll", "boll_ub", "boll_lb",
"macd", "macds", "macdh", "atr",
)
def _verified_rows(symbol: str, curr_date: str) -> pd.DataFrame:
"""OHLCV on or before curr_date, date-sorted. Raises if nothing usable.
``load_ohlcv`` already normalizes the Date column and filters out
look-ahead rows, but we re-apply the cutoff defensively — this is a
verification path, so it must not trust its input to be pre-filtered.
"""
data = load_ohlcv(symbol, curr_date)
if data is None or data.empty:
raise ValueError(f"No OHLCV data available for {symbol}.")
df = data.copy()
df["Date"] = pd.to_datetime(df["Date"], errors="coerce")
df = df.dropna(subset=["Date"])
df = df[df["Date"] <= pd.to_datetime(curr_date)].sort_values("Date")
if df.empty:
raise ValueError(f"No OHLCV rows on or before {curr_date} for {symbol}.")
return df
def _fmt(value) -> str:
if value is None or pd.isna(value):
return "N/A"
if isinstance(value, pd.Timestamp):
return value.strftime("%Y-%m-%d")
if isinstance(value, bool):
return str(value)
if isinstance(value, (int,)):View on GitHub (pinned to a33fd4c0f1)
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
Example fix
# before
rows = _verified_rows("ZZZZZZ", "2025-06-10") # invalid/uncovered ticker
# -> ValueError: No OHLCV data available for ZZZZZZ.
# after
try:
rows = _verified_rows(symbol, curr_date)
except ValueError:
verdict = f"Cannot verify {symbol}: no OHLCV data available" # graceful degradation Defensive patterns
Strategy: try-catch
Validate before calling
from tradingagents.dataflows.stockstats_utils import load_ohlcv
def has_ohlcv(symbol: str, curr_date: str) -> bool:
data = load_ohlcv(symbol, curr_date)
return data is not None and not data.empty Try / catch
try:
rows = _verified_rows(symbol, curr_date)
except ValueError as e:
if "No OHLCV data available" in str(e):
return f"Cannot verify {symbol}: no market data — report as unverifiable"
raise Prevention
- 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
When it happens
Trigger: 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.
Common situations: LLM hallucinating an obscure ticker; delisted symbols in backtests; restricted vendor coverage for the symbol; cache directory wiped between the data step and verification.
Related errors
- No OHLCV rows on or before {curr_date} for {symbol}.
- Yahoo Finance returned no rows
- latest row is {latest.date()}, {stale_days} days before the
- ticker must be a non-empty string, got {value!r}
- ticker exceeds {max_len} chars: {value!r}
AI-assisted analysis of TauricResearch/TradingAgents@a33fd4c0f1 (2026-08-14).
Data as JSON: /api/errors/1a4637bbd90ee997.
Report an issue: GitHub.