Spaces:
Running
Running
Commit History
6 days ago
-
Add 1M (1-month hold) timeframe to watchlist and dashboard Running
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5AI-forecast-only third horizon (~21 sessions, buy-now entry, 2.5x ATR stop) with a sqrt-time ATR band, dedicated 1M direction guardrails, a separate "1 Month picks" dashboard ranking from a no-LLM shortlist, lazy 1M cells on other picks, and a Validation tab 1M card. Fixes silent unknown-timeframe fallbacks (date window, 1W label, 3D prompt, validation deadlines, price window, self-learning token leakage). No ML 1M model; F&O and portfolio insight unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>953b4c2
16 days ago
-
NVIDIA: add nemotron-3.5-bolt-e4b as the first fallback
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5It answers valid forecasts 3/3 at about 4s, while laguna-xs-2.1 (the primary) varies from 1.5s to 9.8s against a ~6s per-provider window. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>3b2af33 -
NVIDIA: make poolside/laguna-xs-2.1 the primary model
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5Of 49 chat models on the key, 35 return 404 not found for account, 8 time out, 4 return empty content and only laguna-xs-2.1 answers (6/6 valid, about 2.3s). openai/gpt-oss-20b timed out 6/6, and with a ~6s per-provider window a hanging primary starved the working model. gpt-oss-20b stays as a fallback. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>8c6b062 -
LLM chain: switch off Cerebras and HuggingFace router by default
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5Both only return 402 for this account (Cerebras: card-gated trial credits gone; HuggingFace: no inference credits left), so every call to them was wasted time and a fail_streak. LLM_DISABLED_PROVIDERS (default cerebras,huggingface) removes them from the provider chain; set it to an empty string to bring them back. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>9274ccc -
LLM providers: put the models that actually answer first
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5An audit of every provider showed which models respond today. Gemini now leads with gemini-3.1-flash-lite (the only Gemini model answering; gemma-4 on Gemini returned no JSON) and SambaNova with gemma-4-31B-it (the others return 429 high demand). Findings and the per-provider causes are recorded in CLAUDE.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>a688bd4 -
F&O AI: wait out a provider's short cooldown instead of failing at once
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5When every cloud provider is rate-limited for a few seconds, the contract forecast failed immediately with ai_provider_unavailable. It now waits for the soonest cooling-down provider, capped at 10s total across attempts, and still fails fast if none will recover in time. The client timeout for contract requests goes from 60s to 75s to cover the wait. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>dbf6890 -
F&O: add F&O-only refresh button; start request timeouts after queue for charts and price polls
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5Adds a 'Refresh F&O' button that re-quotes and re-forecasts only the watchlist's contract cards. Contract price polls now run ahead of equity charts/AI so the 60s refresh is not starved, and the chart loader's 30s timeout starts when the request leaves the queue instead of when it is created. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>51603e5 -
Retrain ML models through 2026-10-27 (was 2026-07-24)
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5Holdout 2026-05-27 to 2026-10-27: INTRADAY dir 81%, 1D 45%, 3D 40%; q10/q90 coverage 87-91% (target ~90%). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>66fc4a7 -
F&O: fix 'signal is aborted' on page open; start timeout after queue and retry failed loads
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5The contract refresh armed its 60s abort timer at call time, so time spent queued behind equity chart/ML requests counted against it and the request was aborted before it ran. The timeout now starts when the request leaves the queue, contract requests go ahead of equity cards, and a thrown error gets the same bounded 8s/20s/45s retry as a provider failure. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>ef66fa6 -
F&O: AI-first card, NSE-based entry price and stop/target exits, resilient first load
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5- Card: AI forecast leads; a failed-validation ML model collapses under "ML check"; ranges keep low-high with a direction marker and a Nearest/Farthest line - New contracts: a missing or lagging NSE chart no longer blocks the AI forecast; failed NSE fetches retry after 5s; frontend retries first-load quote/history/AI failures at 8s/20s/45s - Trade modal: "Use NSE Price" pre-fills a manual entry from the NSE snapshot (/api/fo/quote?snapshot=1, never executable); Live Quote option explains why it is off - Manual positions with a stop/target are auto-closed from the NSE last-traded snapshot (open market, <=5 min old, exact contract); recorded as nse_snapshot Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>4640591 -
Count trading days (not calendar days) before giving up on stale PENDING validations
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>38383a6 -
Fix INTRADAY validation for tickers Yahoo cannot serve 60d of 15m bars
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5- Pick the smallest Yahoo 15m window that reaches the target date, widening until covered - get_intraday_bars steps 60d -> 30d when Yahoo rejects the long window (recent listings) - Add POST /api/validation/reopen-expired to re-grade INTRADAY rows that expired only because their bars could not be fetched (nothing is graded without real bars) - Fix test helper namespaces (date, _watchlist_instrument_type) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>a0cbb64 -
Fix F&O AI provider-unavailable: queue for AI slot, retry with rotated provider, bounded UI retry
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5- Wait up to 8s for one of 3 AI slots instead of rejecting; report ai_busy only after the wait - Retry RuntimeError/TimeoutError provider failures once with a rotated lead provider - Frontend retries provider/busy failures at 8s/20s/45s, then falls back to minute polling Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>d7c8fde -
Add F&O history collector, snapshot-only AI outlook, candlestick contract charts
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5- Record watchlisted F&O premiums server-side (and on add) so forecasts and charts have history without a browser open; retry NSE's intermittent empty chart payload - AI forecast accepts a single observation / last-session snapshot as LOW-confidence limited history; ML keeps requiring real history - Contract chart returns 5m OHLC candles (same green/red config as equities) - Relabel 'History incomplete' as 'Collecting price history'; ML shows 'Validation failed' - Persist observed contract quotes, retry history-incomplete forecasts on the frontend Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>ea309d4
19 days ago
-
Retry transient F&O AI failures and accept irregular observed history
Verified signature59900ed -
Preserve observed history across sparse weekly F&O charts
Verified signature3a0aff2 -
Fix weekly F&O chart outages with persisted exact-contract observations
Verified signature35fa597
22 days ago
-
Show last-session price and AI outlook for F&O watchlist when market is closed
Khanna, Videh Rakesh Rakesh +1: CopilotCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>55803fa
23 days ago
-
Fix F&O forecast refresh, one-minute inputs and card styling
Khanna, Videh Rakesh Rakesh7291f56
27 days ago
-
Request structured F&O AI output and supply exact option moneyness facts
Verified signature17918cd -
Publish explicit experimental F&O models and correct live quote/forecast handling
Verified signature1a03f67
-
Fix portfolio valuation and wire independent F&O targets
Khanna, Videh Rakesh RakeshUse exact-contract portfolio marks, consistent side-aware P&L and safe periodic refresh. Add newer reachable-target research and independent AI forecasts while preserving model quality and age gates.8b054f7 -
Explain portfolio card fields and fix dashboard Invested for F&O
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5- Portfolio cards: add hover descriptions (ⓘ) for Entry, Manual/Live mark, Intended Target, P&L and Lots/Quantity, tooltips on F&O badges, Fees note and Mark Price button, plus a plain-English "How to read this" line on open F&O cards (works on touch devices). - Dashboard "Invested" now includes long-option premium and futures/short-option margin, matching the Portfolio view (was ₹0.00 with only an option open). - Add separate F&O premium-model pipeline (fo_predictor, training script, fail-closed manifest, tests) and wire it into the F&O watchlist contract pick. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>6745bb7 -
Add exact-contract F&O charts and matching watchlist cells
Khanna, Videh Rakesh Rakesh92d54aa -
Fix exact-contract F&O watchlist snapshots
Khanna, Videh Rakesh Rakeshd809f52
-
Use free equity quote snapshots in the watchlist
Khanna, Videh Rakesh Rakeshae185d5 -
Fix F&O search with automatic Dhan contract discovery
Khanna, Videh Rakesh Rakesha1620df -
Add indices futures and options to watchlist search
Khanna, Videh Rakesh Rakesh25ec864
-
Add provider-independent F&O paper trading for learning
Khanna, Videh Rakesh Rakeshae7951c
-
Add Dhan live data, automatic auth and Nifty 50 top picks
Khanna, Videh Rakesh RakeshAdd read-only streaming and candles, encrypted PIN/TOTP token management, and persisted Yahoo-only fallback after two retries. Restrict dashboard picks and caches to verified Nifty 50 membership, with regression tests and setup documentation.00366c3
-
Optimize AI provider routing and website prediction latency
Khanna, Videh Rakesh Rakesh27765e2 -
Fix news fetching and reliability regressions
Khanna, Videh Rakesh Rakesh21db26a -
Predict AI forecast for recently listed stocks instead of refusing below 200 bars
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5predict_stock_v2 hard-refused anything under 200 bars, so recent IPOs (e.g. RENTOMOJO, 17 bars) got no AI prediction even though the ML model had been relaxed. Refuse only below a 15-bar floor; between 15 and 199 bars predict as a degraded call: confidence is capped to LOW and the result carries low_history/history_bars. get_ml_feature_score's early return now includes the "upgraded" key the caller indexes (it raised KeyError for short history). ml_predictor MIN_BARS lowered 20 -> 15 to match. The watchlist payload passes low_history through and the TF cell shows a "New listing" badge; stale "after 200 bars" messages reworded. Cache buster bumped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>6887c6c -
Fix ticker search with .NS suffix; make server-wide intraday AI refresh opt-in
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5.5Typing "RELIANCE.NS" in the watchlist add box matched nothing because universe matching is on the bare symbol; strip the .NS/.BO suffix and also match the bare symbol substring. Drop out-of-order suggestion responses. The process-wide INTRADAY AI sweep duplicated the browser's own progressive refresh and burned provider quota with nobody viewing; it now requires WATCHLIST_SERVER_AUTO_REFRESH=1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>16844ee
-
Add restart-safe SQLite caches for watchlist, universe, and top picks
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5Watchlist prediction/price cards, the NSE universe, and Top Picks were all in-memory-only, so an app restart (or an HF Spaces container restart) forced every card back through a live Yahoo/LLM fetch before rendering anything. Persist each to SQLite so a restart bootstraps from the last completed result immediately, then refreshes stale timeframe cells progressively in the background. Top Picks startup prewarming becomes opt-in via TOP5_AUTO_PREWARM=1 to avoid an unconditional quota-heavy scan on boot; ticker search now serves the persisted universe cache immediately and refreshes it in the background instead of blocking on a remote Yahoo lookup. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>4c2ff6a -
Predict for low-history tickers instead of hard-refusing below 205 bars
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5ml_predictor previously refused any prediction below 205 bars (the model's training minimum), even though every short-window feature is already computable and neutral-defaulted well before that. Add a degraded tier (20-204 bars): predict using the existing model, force confidence to LOW, and flag it, instead of returning ml_unavailable. Below 20 bars still refuses as unusable. Also lower the dead 26-bar guard in compute_features() to the new 20-bar floor, and fix the frontend's stale "awaiting 26 daily bars" message to report real bar counts from the API instead of a hardcoded, drifted number. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>5703a07
-
Add manual buy and short trade actions
Khanna, Videh Rakesh Rakeshcac64bb -
Add intraday short action to watchlist
Khanna, Videh Rakesh Rakesh1da9745
-
Improve dashboard trade actions and loading
Khanna, Videh Rakesh Rakesh4d6a2c6
-
Retrain ML models through 2026-07-24 (was 2026-07-10)
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 4.6351k rows · 2158 tickers · 2022-05-12 → 2026-07-24 Train ≤ 2026-02-19 · holdout 2026-02-24 → 2026-07-24 (36k rows) INTRADAY: dir_acc=82% (↑ from 81.5%), q90 coverage=88% 1D: dir_acc=44%, q90 coverage=90% 3D: dir_acc=41%, q90 coverage=91% Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>68dc5e0 -
feat: show short target in watchlist CTA
Khanna, Videh Rakesh Rakesh42aa489 -
Speed up watchlist load and prediction hydration
Khanna, Videh Rakesh Rakesh3e9f74f
-
Fix ML watchlist range refresh and improve IPO/model hygiene
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 4.6- Force ?refresh=1 on ML forced-fetches so server recomputes live_price instead of returning a 60s-cached response; ₹ targets now visibly update every 5 min during market hours - Add dedicated "🤖 ML as-of HH:MM:SS IST" timestamp on each ML row so the ML fetch time is distinct from the AI cell's "Updated" clock above it - Update % range tooltip to clarify it is session-static (daily model features from yesterday's close); ₹ range tooltip says it updates live - Raise ML hard-abort from 26 → 205 bars (matching dataset.py training floor) with a descriptive IPO/short-history error message; previously the model silently extrapolated outside its training distribution - Fix _start_intraday_refresh_scheduler docstring: "every 15 min" → "3 min" - Add SHORT-trade API tests (open, reject invalid direction, close P&L) - Bump cache buster to v=20260902d Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b85a206 -
Fix watchlist auto-refresh and add fallback direction badges
Khanna, Videh Rakesh Rakeshb8f217c -
Handle transient watchlist DB locks and cover with API tests
Khanna, Videh Rakesh Rakesh8d5fcbc -
Fix watchlist refresh cache bypass and add TF update timestamps
Khanna, Videh Rakesh Rakesh0759370
-
Fix NEUTRAL forcing: allow elastic directional calls when indicators lean clear
Khanna, Videh Rakesh Rakesh- Modified synthesis prompt guidance for 1D, 3D, 5D timeframes - Added 'ELASTIC DIRECTIONAL CALLS' concept: make directional call at MEDIUM confidence when indicators lean strongly one way, even if exact trigger definitions don't fire perfectly - Redefined NEUTRAL: emphasize it applies ONLY when indicators are genuinely flat (no trigger AND price/momentum/RSI/MACD all indecisive) - Prevents overuse of NEUTRAL when signals_active=0 but chart clearly trends - Aligns LLM prompt intent with existing guardrail architecture (AI_DIRECTIONAL_NEITHER_1D3D already supports keeping direction with reduced confidence) - No breaking changes: backward compatible, guardrails still override when needed Example: Stock with Price>EMA50 + MACD>0 + 10D mom +2.8% but RSI=72 (misses T1 cutoff) now returns BULLISH@MEDIUM instead of NEUTRAL, matching the clear uptrend evident in price action.9a06494 -
fix: make watchlist search and add responsive
Khanna, Videh Rakesh Rakesh314bc32 -
fix: improve performance and reliability (7 production issues)
Khanna, Videh Rakesh RakeshFIXES: 1. Chart loading slow - added server-side cache with 5min INTRADAY/1hr daily TTL 2. INTRADAY 5-min refresh - verified working (browser throttling handled) 3. Target hit re-evaluation - verified working (60s polling with re-fetch) 4. LLM provider 402 handling - enhanced quota detection (10+ patterns) 5. IPO not in search - force universe refresh when <100 tickers cached 6. Search unreliable - improved fallback with exact/starts/contains prioritization 7. Testing/validation - comprehensive test plan and documentation added CHANGES: - app.py: Chart caching (3 vars, 13 lines) + Search improvements (60 lines) - llm_client.py: Enhanced _is_daily_quota_429() classifier - static/app.js: Verified working, no changes needed - templates/index.html: Minor formatting updates - top5_picker.py: Consistency updates - FIXES_2026_08_31.md: Comprehensive documentation of all changes BACKWARD COMPATIBILITY: ✅ All changes are fully backward compatible ✅ No breaking API changes ✅ Optional force-ref…87a57e1
-
Fix AI-loop (dead LLM provider models) + slow ML (CPU contention)
Khanna, Videh Rakesh Rakeshllm_client.py: - Groq dropped all Llama-3.x (llama-3.3-70b-versatile + llama-3.1-8b-instant now 404). Primary now openai/gpt-oss-120b (reads GROQ_MODEL); always appends gpt-oss-120b/-20b so a stale HF secret can't break the provider. - NVIDIA nemotron-super-49b hit EOL 2026-08-26 (410) + fallback unserved; default now openai/gpt-oss-20b, guaranteed-appended. - gpt-oss are reasoning models: at small token budgets (fundamentals=200, bull/bear=320) hidden reasoning ate the whole budget → EMPTY content → provider treated as failed. New _payload() injects reasoning_effort='low' for gpt-oss only. - 402 (Cerebras billing / any provider) now benches until reset instead of retrying every minute. app.py /api/ml-predict: - Server-side _ML_PREDICT_CACHE (market-aware TTL: 60s open / 30m closed) checked before the live-price fetch — collapses the watchlist/top-picks request storm. - _ML_COMPUTE_SEMAPHORE bounds concurrent CPU-bound compute (measured 10 concurrent calls = 20s vs 1s …196229f