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
-
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 -
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 -
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 -
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
-
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
-
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
-
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 -
Fix watchlist refresh cache bypass and add TF update timestamps
Khanna, Videh Rakesh Rakesh0759370
-
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
-
Intraday: re-evaluate AI + ML calls when live price hits target
Khanna, Videh Rakesh RakeshWhen the live price reaches an INTRADAY call's target, produce a fresh target off the new level instead of serving a passed/floated target. - app.py: _intraday_target_reached helper; per-TF serve path + refresh scheduler recompute AI on target hit and tag intraday_reevaluated. - app.py: _ML_INTRADAY_TARGET store + /api/ml-predict re-eval detection. - app.js: _intradayCrossOne now also force-refetches ML on target cross; green 'target hit / re-evaluated' badges on AI and ML rows. - style.css: .tf-reeval / .tf-ml-reeval badge styles; cache-buster bump.c72fd40
-
fix(ml-ui): keep ML target inside its displayed range
Khanna, Videh Rakesh RakeshThe ML row tightened its shown range around the raw q50 quantile, but the headline Target comes from expected_target_price (backend derives it from the recalibrated/capped median — INTRADAY scales q50 by ~0.42). The raw median is higher, so the tightened low bound was pushed above the target, making Target render below the range (e.g. Target 1063 under 1065-1075). Center the tightening on the same expected move the target uses (from expected_target_price/current_price) so the target always sits inside the shown band. Display-only; raw quantiles read by backtests are untouched. Cache-buster bumped to 20260810b.bf46fe1 -
feat(intraday): auto re-run AI every 5 min + on target cross (watchlist & top picks)
Khanna, Videh Rakesh RakeshINTRADAY forecasts weren't updating: the watchlist auto-refresh only warmed the server cache without repainting, and both watchlist and top picks re-fetched without refresh=1 so the 15-min server cache returned stale results. - Watchlist + top picks now repaint the INTRADAY AI cell in place every 5 min, forcing a fresh AI call (refresh=1) that bypasses the 15-min cache. - New target-cross trigger: polls live price every 60s and re-runs the INTRADAY AI the moment price crosses the predicted target (once per (ticker, target)), for both watchlist and top picks. - _fetchAndUpdateTfCell gains a force opt + a silent guard so a transient timeout/ai_unavailable never overwrites a good cell during auto-refresh. - Tab-focus catch-up forces both surfaces. Bump cache-buster to 20260810a.21d1600
-
Add tab-visibility catch-up refresh for INTRADAY auto-refresh loops
Khanna, Videh Rakesh Rakesh- static/app.js: browsers throttle background-tab timers heavily (Chrome intensive throttling after ~5 min hidden), so the 3-min watchlist/top-pick and 5-min ML INTRADAY setInterval loops stopped firing while the tab wasn't focused. Added a visibilitychange listener that fires an immediate catch-up refresh when the tab becomes visible again (debounced 15s). - templates/index.html: bump cache-buster to v=20260804a. - CLAUDE.md: document the visibility catch-up fix and the earlier app.run(threaded=True) fix (Flask single-threaded blocking made ML predict look permanently stuck behind slow AI calls).b45ee11
-
UI: fix misleading neutral_signal message, default validation view to Both
Khanna, Videh Rakesh Rakesh- neutral_signal no-trade reason no longer claims 'strategy signals are firing' when signal_count is 0 (AI-led NEUTRAL calls bypass the strategy signal gate and can fire independent of signal_count). - Default validation source toggle to 'Both' (was 'ai'). - Bump cache-buster to v=20260803b.1c4d2ec
-
Fix wide NEUTRAL bands, live/pre-market target re-anchoring, stop-loss guard; add ₹ range to ML row
Khanna, Videh Rakesh Rakesh- NEUTRAL/1D range-only bands now flat ±1% (falsifiable) across ai_forecast, predictor_core, ml_predictor — no more unbettable ±5% ATR bands - Re-anchor cached targets to live/pre-market price in watchlist + top picks so ranges aren't already-surpassed - Server-side stop-loss/target sanity guard: prevent LONG stop above entry (instant stop-out) on actual-entry drift - Top picks now expose current_price - ML row shows ₹ price range mirroring the AI, derived from the same tightened band - Bump UI cache-buster 20260728h -> 20260729a217447c
-
Force 1D range-only, volatility-scaled ML caps, sector-mode Top Picks, self-learning throttle + collapsible panel
Khanna, Videh Rakesh Rakesh- predictor_core/ml_predictor: force 1D predictions to range-only NEUTRAL (ATR-scaled ±3.5%) in both AI and ML paths; 1D next-day direction ceiling ~74% made directional targets unreachable. - ml_predictor/infer.py: replace fixed ML range caps with volatility-scaled caps (mult x stock ATR%, clamped floor/ceiling); ML_DISABLE_RANGE_CAP toggle. Add low-history guard (<250 bars -> confidence downgrade + low_history flag) for IPOs like BLUESTONE. A/B backtest confirms cap ON == cap OFF on normal-vol stocks (pure outlier guard). - sector_pulse/top5_picker: sector-volatility-driven Top Picks candidate pool with AI-only selection (TOP5_SECTOR_MODE); get_sector_volatility + constituents. - self_learning/app.py: throttle expensive LLM calibration to every SELF_LEARN_LLM_INTERVAL_DAYS (default 7); reuse prior notes between refreshes while cheap target/bucket stats + learnings.json still refresh each validation; manual Improve AI forces refresh. - frontend: collapsible Self-Learning Insights pane…17b15cc -
UI: 2-card (INTRADAY/1D) grid layout — tf-grid/wl-summary/port-insight columns; update CLAUDE.md
Khanna, Videh Rakesh Rakesh8cd92f9 -
Intraday 1% minimum: floor best-case to 1% (AI+ML+core) instead of skipping sub-1% calls — intraday routinely clears 1%
Khanna, Videh Rakesh Rakesh7a66a03 -
Intraday: 1% min-move gate (AI+ML), pre-market preview, momentum override, top-pick INTRADAY auto-refresh; retire 3D/5D from live view+API
Khanna, Videh Rakesh Rakeshac1382f
-
Self-learning: fix N=0 (missing validation cols), all-history window, why-missed notes; INTRADAY final-call cache after close
Khanna, Videh Rakesh RakeshSelf-learning (Improve AI / ML): - get_prediction_snapshots now SELECTs validation_status/result + window/actual cols so analyze_and_update actually sees validated rows (was always N=0). - Remove 30-day window: analyze all history (days=None); idempotent aggregation rebuilt from dedup union of DB rows + pruned history (fixes double-count on re-run). - Add target-reach diagnostics (predicted high/low/mid vs actual window high/low) explaining why a target was missed; styled MISS/CAUTION/OK in the panel. INTRADAY final call: - Cache the last valid intraday call (with target) per ticker during the session and show it as the session's Final Call after NSE closes / past 14:15, instead of the 'market closed' stub. Wired into single/per-TF/batch watchlist endpoints and the intraday refresh scheduler; frontend shows a 'Final call' badge. - Cache-buster v=20260727b.e61a2dc -
Fix ML NEUTRAL/gapped-target UI: mark range-bound as no-trade, remove contradictory gapped-past-target warning
Khanna, Videh Rakesh Rakesh- ML NEUTRAL/range-bound cells now show a clear 'no trade' tag and 'Range-bound - no buy' target line - Remove stale gapped_past_target flag: it compared live price to a close-anchored target while the displayed target is re-anchored to live, making the warning always contradict the visible range - Bump cache-buster to 20260724c697340b
-
Add NVIDIA NIM as free-tier LLM provider; research + UI updates
Khanna, Videh Rakesh Rakesh- Wire NVIDIA NIM (build.nvidia.com) into llm_client provider chain as a zero-cost 7th cloud provider via shared _try_openai_compatible driver (inherits timeout/retry/cooldown/daily-exhausted machinery) - Default to fast nemotron-super-49b (70b slug read-times-out on free tier) - Update CLAUDE.md, project_context.json provider-chain metadata - gitignore paper_trading.db.local_backup* and models_holdout_eval/ - Misc research scripts + UI/database updates8d1eb7b
-
ML intraday-high guard, yfinance thread-safety, validation consistency
Khanna, Videh Rakesh Rakesh- app.py: fetch today's intraday HIGH for the ML already_gone/headroom guard so INTRADAY never emits a target the stock has already passed; skip grading a prediction whose entry price is grossly outside the price window (yfinance cross-ticker contamination) so it stays PENDING instead of a false MISS. - intraday_live.py: serialize yf.download with a lock + group_by='ticker' and reject responses whose top column level isn't the requested ticker. - research backtests: handle expected_target_price=None (range-bound NEUTRAL). - style.css: .tf-ml-gone / .tf-range-bound; cache-buster v=20260723c. - research: add ml_confidence_sweep.py, fix_mismatched_validations.py.0602ac7