Spaces:
Running
Running
Commit History
-
Real direction-accuracy/P&L measurement + BULLISH trigger fixes
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 5The backtest only ever graded whether price touched a predicted band (target_hit_for_tf), which a deliberately low near-bound wins regardless of whether a direction call has any real edge. Added a standing real DirAcc + net P&L report (TABLE 6, research/backtest.py) and used it to find and fix three BULLISH triggers that were worse than a coin flip (T4, T5, T7 in ai_forecast.py), plus a relative-strength-vs-Nifty guard that blocks BULLISH on stocks structurally underperforming the market (mirrors ml_predictor's already-validated excess-of-Nifty labels). Net result on a 200-row diverse backtest: 1D BULLISH direction accuracy improved 54.2% -> 56.4% on 12 of 15 tickers; 3 known-hard stocks (HDFCBANK, TITAN, SUNPHARMA) remain a resistant drag after extensive targeted iteration - accepted as a genuine ceiling, not a fixable bug. Also includes the earlier, separately-validated INTRADAY/1D NEUTRAL-band widening (1D target_hit_for_tf 83.3% -> 88.9%) and a real bug fix: the Ollama fallback's…5342112
-
feat: Gemini/SambaNova providers, ATR power-law range model, crash-guard triggers, backtest retry rounds
Khanna, Videh Rakesh Rakesh +1: Claude Sonnet 4.6- llm_client: add Gemini 2.5-flash (5th) and SambaNova 70B (6th) cloud providers; Ollama model switched to qwen2.5:1.5b (best JSON reliability), health neg-TTL 10s for fast cold-start re-probe - ai_forecast: rebuild ATR band from per-TF magic numbers → power-law formula (BASE×days^EXP) covering any horizon; _atr_clamp_range now enforces directional-sign (BULLISH lo/hi both positive, BEARISH both negative) and re-anchors when guardrails flip direction - ai_forecast guardrails: crash-exhausted gate (10D<-6% or 20D<-8%) suppresses T4/T6 oversold-bounce triggers; T1 blocked when RSI>70; B2 relaxed (RSI>42, 10D<-4%); B3 new (crash+MACD<0 → BEARISH); conflict → NEUTRAL; no-trigger → force NEUTRAL - app.py: all watchlist predict routes use fast_fail=True + 90s per-ticker / 90s bulk deadlines; timeout TFs return immediately so frontend auto-retries fill them in background - backtest: deferred-retry rounds (default 3, 90s cooldown), bounded per-stock attempt, stream successes to CSV immediately…36199b8