Add yfinance fallback for gold/silver + coarse Telegram progress

- yfinance>=0.2.40 added as a hard dependency
- _fetch_yfinance_fallback(): pulls OHLCV from Yahoo for symbols not on
  the Twelve Data free tier (XAUUSD → GC=F, XAGUSD → SI=F)
- Hooked into both batch and single-symbol fetch paths; logs as [yf]
  to distinguish from Twelve Data [live]
- Fail-loud: if both providers return nothing, the pair is skipped with
  the existing "data unavailable" message
- _analyze_all_tfs accepts an async progress callback; both /signal and
  /scan now show coarse milestones via message edits:
    "📡 Fetching market data..."  →  "🧠 Analyzing pairs..."  →  result
- prefetch_batch is now run in a thread so it doesn't block the event loop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Harwinder
2026-05-05 14:40:19 -04:00
parent 492b39313a
commit 6a75ed1ffb
3 changed files with 117 additions and 4 deletions
+1
View File
@@ -1,4 +1,5 @@
numpy>=1.24
pandas>=2.0
requests>=2.28
yfinance>=0.2.40
python-telegram-bot[job-queue]>=20.0