From 20d3e9fbbe4704ff8581066656df1672da2b8643 Mon Sep 17 00:00:00 2001 From: Youssef Aitousarrah Date: Tue, 14 Apr 2026 22:56:05 -0700 Subject: [PATCH] feat(discovery): add mean_reversion pipeline for RSI oversold scanner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rsi_oversold scanner is a contrarian signal, not a momentum signal — it fires on short-term panic pullbacks within uptrends and expects a 3-7 day bounce. Keeping it in the momentum pipeline conflates two fundamentally different signal types and could cause the ranker to misprice it. Changes: - Add mean_reversion pipeline (priority 6, deep_dive_budget 5) to default_config.py - Move rsi_oversold scanner from pipeline="momentum" to pipeline="mean_reversion" in both default_config.py and rsi_oversold.py Co-Authored-By: Claude Sonnet 4.6 --- .../dataflows/discovery/scanners/rsi_oversold.py | 2 +- tradingagents/default_config.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tradingagents/dataflows/discovery/scanners/rsi_oversold.py b/tradingagents/dataflows/discovery/scanners/rsi_oversold.py index 6cae0cba..ee19ed3f 100644 --- a/tradingagents/dataflows/discovery/scanners/rsi_oversold.py +++ b/tradingagents/dataflows/discovery/scanners/rsi_oversold.py @@ -39,7 +39,7 @@ class RSIOversoldScanner(BaseScanner): """ name = "rsi_oversold" - pipeline = "momentum" + pipeline = "mean_reversion" strategy = "mean_reversion_bounce" def __init__(self, config: Dict[str, Any]): diff --git a/tradingagents/default_config.py b/tradingagents/default_config.py index a75b434b..2b71273c 100644 --- a/tradingagents/default_config.py +++ b/tradingagents/default_config.py @@ -110,6 +110,12 @@ DEFAULT_CONFIG = { "deep_dive_budget": 5, }, "events": {"enabled": True, "priority": 5, "deep_dive_budget": 3}, + "mean_reversion": { + "enabled": True, + "priority": 6, + "ranker_prompt": "mean_reversion_ranker.txt", + "deep_dive_budget": 5, + }, }, # ======================================== # OHLCV CACHE (populated nightly by prefetch workflow) @@ -273,7 +279,7 @@ DEFAULT_CONFIG = { }, "rsi_oversold": { "enabled": True, - "pipeline": "momentum", + "pipeline": "mean_reversion", "limit": 10, "max_tickers": 0, # 0 = no cap (nightly cache makes full universe fast) "rsi_period": 2, # Connors RSI(2): most sensitive to short-term pullbacks