we-promise/sure · error · Provider::YahooFinance::Error

No chart data found for #{symbol}

Error message

No chart data found for #{symbol}

What it means

Error "No chart data found for #{symbol}" thrown in we-promise/sure.

Source

Thrown at app/models/provider/yahoo_finance.rb:342

  def fetch_security_prices(symbol:, exchange_operating_mic: nil, start_date:, end_date:)
    with_provider_response do
      symbol = normalize_symbol(symbol, exchange_operating_mic)
      validate_date_params!(start_date, end_date)
      # Convert dates to Unix timestamps using UTC to ensure consistent epoch boundaries across timezones
      period1 = start_date.to_time.utc.to_i
      period2 = end_date.end_of_day.to_time.utc.to_i

      throttle_request
      data = fetch_authenticated_chart(symbol, {
        "period1" => period1,
        "period2" => period2,
        "interval" => "1d",
        "includeAdjustedClose" => true
      })

      chart_data = data.dig("chart", "result", 0)

      raise Error, "No chart data found for #{symbol}" unless chart_data

      timestamps = chart_data.dig("timestamp") || []
      quotes = chart_data.dig("indicators", "quote", 0) || {}
      closes = quotes["close"] || []

      # Get currency from metadata
      meta_exchange = chart_data.dig("meta", "exchangeName") || ""
      raw_currency = chart_data.dig("meta", "currency")
      raw_currency ||= default_currency_for_exchange(meta_exchange) || "USD"

      prices = []
      timestamps.each_with_index do |timestamp, index|
        close_price = closes[index]
        next if close_price.nil? # Skip days with no data (weekends, holidays)

        # Normalize currency and price to handle minor units
        normalized_currency, normalized_price = normalize_currency_and_price(raw_currency, close_price.to_f)

View on GitHub (pinned to e69894adb9)

When it happens

Trigger: Thrown at app/models/provider/yahoo_finance.rb:342 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of we-promise/sure@e69894adb9 (2026-08-21). Data as JSON: /api/errors/479b0e4d29d1d364. Report an issue: GitHub.