Add multi-factor conviction gate to activation
Make "qualified" mean an edge candidate, not just R:R + confidence. The gate now also requires (all admin-configurable, defaults on): - high conviction: recommended_action LONG_HIGH / SHORT_HIGH only - clean read: risk_level Low (no contradicting signals) - probable primary target: best target probability >= min (default 60) - Shared predicate: app/services/qualification.py + frontend/src/lib/qualification.ts (mirrored) - Activation config extended (min_target_probability, require_high_conviction, exclude_conflicts) with bool-aware get/update + validation - /trades/performance switched to ?qualified_only=true, applying the full gate server-side; confidence breakdown stays unfiltered - Dashboard "Qualified", Signals "Qualified only" toggle, and Track Record all use the one gate; Admin gains the new controls Sentiment provider runtime config (prior change) included. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+16
-1
@@ -59,6 +59,21 @@ class TickerUniverseUpdate(BaseModel):
|
||||
|
||||
|
||||
class ActivationConfigUpdate(BaseModel):
|
||||
"""Activation thresholds: what counts as an actionable signal."""
|
||||
"""Activation gate: what counts as an actionable signal."""
|
||||
min_rr: float | None = Field(default=None, ge=0)
|
||||
min_confidence: float | None = Field(default=None, ge=0, le=100)
|
||||
min_target_probability: float | None = Field(default=None, ge=0, le=100)
|
||||
require_high_conviction: bool | None = None
|
||||
exclude_conflicts: bool | None = None
|
||||
|
||||
|
||||
class SentimentConfigUpdate(BaseModel):
|
||||
"""Runtime sentiment LLM config. api_key is write-only; omit/empty to keep
|
||||
the stored key."""
|
||||
provider: Literal["openai", "gemini"] | None = None
|
||||
model: str | None = Field(default=None, max_length=100)
|
||||
api_key: str | None = Field(default=None, max_length=400)
|
||||
|
||||
|
||||
class SentimentTestRequest(BaseModel):
|
||||
ticker: str = Field(default="AAPL", max_length=10)
|
||||
|
||||
Reference in New Issue
Block a user