fix(filter): deprioritize recent movers instead of dropping, exempt mean_reversion pipeline
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
471030facc
commit
9112b14177
|
|
@ -8,6 +8,7 @@ import pandas as pd
|
||||||
from tradingagents.dataflows.data_cache.ohlcv_cache import download_ohlcv_cached
|
from tradingagents.dataflows.data_cache.ohlcv_cache import download_ohlcv_cached
|
||||||
from tradingagents.dataflows.discovery.candidate import Candidate
|
from tradingagents.dataflows.discovery.candidate import Candidate
|
||||||
from tradingagents.dataflows.discovery.discovery_config import DiscoveryConfig
|
from tradingagents.dataflows.discovery.discovery_config import DiscoveryConfig
|
||||||
|
from tradingagents.dataflows.discovery.scanner_registry import SCANNER_REGISTRY
|
||||||
from tradingagents.dataflows.discovery.utils import (
|
from tradingagents.dataflows.discovery.utils import (
|
||||||
PRIORITY_ORDER,
|
PRIORITY_ORDER,
|
||||||
Strategy,
|
Strategy,
|
||||||
|
|
@ -479,7 +480,6 @@ class CandidateFilter:
|
||||||
|
|
||||||
if reaction.get("status") == "lagging":
|
if reaction.get("status") == "lagging":
|
||||||
# Mean-reversion candidates are expected to have moved — exempt them
|
# Mean-reversion candidates are expected to have moved — exempt them
|
||||||
from tradingagents.dataflows.discovery.scanner_registry import SCANNER_REGISTRY
|
|
||||||
source = cand.get("source", "")
|
source = cand.get("source", "")
|
||||||
scanner_cls = SCANNER_REGISTRY.scanners.get(source)
|
scanner_cls = SCANNER_REGISTRY.scanners.get(source)
|
||||||
scanner_pipeline = getattr(scanner_cls, "pipeline", None)
|
scanner_pipeline = getattr(scanner_cls, "pipeline", None)
|
||||||
|
|
@ -979,8 +979,6 @@ class CandidateFilter:
|
||||||
|
|
||||||
def _assign_strategy(self, cand: Dict[str, Any]):
|
def _assign_strategy(self, cand: Dict[str, Any]):
|
||||||
"""Assign strategy by looking up the scanner's declared strategy from the registry."""
|
"""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", "")
|
source = cand.get("source", "")
|
||||||
scanner_class = SCANNER_REGISTRY.scanners.get(source)
|
scanner_class = SCANNER_REGISTRY.scanners.get(source)
|
||||||
if scanner_class and getattr(scanner_class, "strategy", None):
|
if scanner_class and getattr(scanner_class, "strategy", None):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue