From 425874931ffd3e3cef60262f7f0b7cb678629278 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sun, 29 Mar 2026 18:04:14 -0700 Subject: Add yfinance fallback for historical ratios when FMP quota is exhausted FMP free tier caps at 250 req/day; hitting the limit caused the Historical Ratios tab to show an error. get_historical_ratios_yfinance now computes margins, ROE, ROA, D/E, P/E, P/B, P/S, and EV/EBITDA directly from yfinance income statements, balance sheets, and price history. FMP functions fall back to this automatically when they receive an empty response. Co-Authored-By: Claude Sonnet 4.6 --- components/valuation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components') diff --git a/components/valuation.py b/components/valuation.py index 0c50a28..4dea754 100644 --- a/components/valuation.py +++ b/components/valuation.py @@ -640,7 +640,7 @@ def _render_historical_ratios(ticker: str): metric_rows = get_historical_key_metrics(ticker) if not ratio_rows and not metric_rows: - st.info("Historical ratio data unavailable. Requires FMP API key.") + st.info("Historical ratio data unavailable.") return # Merge both lists by date -- cgit v1.3-2-g0d8e