From 9112b14177293d79be73df042bee9b2d129e7cac Mon Sep 17 00:00:00 2001 From: Youssef Aitousarrah Date: Wed, 15 Apr 2026 13:28:08 -0700 Subject: [PATCH] fix(filter): deprioritize recent movers instead of dropping, exempt mean_reversion pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change recent_mover_action default from "filter" to "deprioritize" so candidates that moved >10% in the past 7 days reach the ranker (with lowered priority + context annotation) rather than being silently dropped - Exempt mean_reversion pipeline candidates (rsi_oversold) from the recent-mover action entirely — stocks that pulled back hard are the signal, not a disqualifier - Hoist SCANNER_REGISTRY import to module level (removes duplicate inline imports) Co-Authored-By: Claude Sonnet 4.6 --- tradingagents/dataflows/discovery/filter.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tradingagents/dataflows/discovery/filter.py b/tradingagents/dataflows/discovery/filter.py index 5ee83217..c8bbc3d2 100644 --- a/tradingagents/dataflows/discovery/filter.py +++ b/tradingagents/dataflows/discovery/filter.py @@ -8,6 +8,7 @@ import pandas as pd from tradingagents.dataflows.data_cache.ohlcv_cache import download_ohlcv_cached from tradingagents.dataflows.discovery.candidate import Candidate from tradingagents.dataflows.discovery.discovery_config import DiscoveryConfig +from tradingagents.dataflows.discovery.scanner_registry import SCANNER_REGISTRY from tradingagents.dataflows.discovery.utils import ( PRIORITY_ORDER, Strategy, @@ -479,7 +480,6 @@ class CandidateFilter: if reaction.get("status") == "lagging": # Mean-reversion candidates are expected to have moved — exempt them - from tradingagents.dataflows.discovery.scanner_registry import SCANNER_REGISTRY source = cand.get("source", "") scanner_cls = SCANNER_REGISTRY.scanners.get(source) scanner_pipeline = getattr(scanner_cls, "pipeline", None) @@ -979,8 +979,6 @@ class CandidateFilter: def _assign_strategy(self, cand: Dict[str, Any]): """Assign strategy by looking up the scanner's declared strategy from the registry.""" - from tradingagents.dataflows.discovery.scanner_registry import SCANNER_REGISTRY - source = cand.get("source", "") scanner_class = SCANNER_REGISTRY.scanners.get(source) if scanner_class and getattr(scanner_class, "strategy", None):