Commit Graph

3 Commits

Author SHA1 Message Date
swj.premkumar 1f279a9df2 - **Insider Veto Protocol (Rule B)**: Hard-coded safety gate in `trading_graph.py` that blocks ALL buy signals if Net Insider Selling exceeds $50M while the stock is in a technical downtrend (Price < 50 SMA). This prevents "Falling Knife" catches.
- **Relative Strength Determinism**: Upgraded `market_analyst.py` to calculate a mathematical `risk_multiplier` (0.0x - 1.5x) based on the Asset Regime vs. SPY Regime correlation, removing LLM "confidence" hallucinations from position sizing.
- **Portfolio Awareness (Rule 72)**: Implemented State Persistence (`portfolio`, `cash_balance`) and a hard-coded Stop Loss check in `trading_graph.py`. If a position's unrealized PnL drops below -10%, the system forces a "LIQUIDATE" order, bypassing all AI debate.
- **Self-Tuning Architecture**: Updated `reflection.py` to output a structured JSON block (`UPDATE_PARAMETERS`) instead of prose advice, enabling future automated parameter optimization.
2026-01-13 05:27:24 -06:00
swj.premkumar e88a01d0ea Fixed
Override Logic Mismatches: Fixed critical Enum-to-String type mismatch in
apply_trend_override
 that was silencing the "Safety Valve" logic.
Data Pipeline Failures: Injected robust error handling and type checking in
market_analyst.py
 to identify why RegimeDetector receives invalid data (causing "UNKNOWN" regimes).
Gemini 404 Errors: Removed invalid/deprecated model names causing 404s
2026-01-11 20:13:01 -06:00
swj.premkumar a6e4c9b770 feat: implement trend override, harden regime detection, and organize tests
**Core Logic (Safety Valve & Regime Detection):**

  *   Added "Momentum Override": `Overall Return > 30%` now forces `TRENDING_UP` (Bull) regime to capture volatile winners.
    *   Prioritized Trend Strength (ADX) over Volatility for single stocks.
    *   Fixed `Hurst Exponent` calculation to handle non-positive inputs safely.
*   **Data Reliability ([market_analyst.py]
2026-01-11 11:18:46 -06:00