--- title: Ahsan Stock Portfolio AI Center emoji: 📈 colorFrom: blue colorTo: indigo sdk: docker app_file: app.py pinned: false --- # Ahsan Stock Portfolio AI Center (Live Quotes + AI Insights) This Space runs a **FastAPI** app (served on port **7860**) that: - pulls **live quotes** (Finnhub or Twelve Data), - shows **portfolio P/L**, winners/losers, - fetches **latest news** (Finnhub if configured) + one‑click source links, - computes **Buy/Sell/Hold** signals using technical indicators (SMA/RSI/MACD), - provides a lightweight **forecast** (statistical projection) and optional **LLM explanation** via Hugging Face Inference. ## Required secrets (Settings → Variables and secrets) Choose **one** market data provider: ### Option A — Finnhub (recommended) - `FINNHUB_API_KEY` = your Finnhub token ### Option B — Twelve Data - `TWELVEDATA_API_KEY` = your Twelve Data key Optional (for AI explanations): - `HF_TOKEN` = your Hugging Face access token - `HF_TEXT_MODEL` = model repo id (example: `google/gemma-2-2b-it`) ## Notes - “Real-time” depends on your provider/plan and may be delayed. - Signals/forecasts are **not financial advice**.