promote residual momentum ranking
This commit is contained in:
@@ -31,7 +31,7 @@ from app.services.recommendation_service import enhance_trade_setup
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
STRATEGY_VERSION = "momentum_12_1_rr_time_v1"
|
||||
STRATEGY_VERSION = "residual_momentum_12_1_rr_time_v2"
|
||||
|
||||
|
||||
async def _get_ticker(db: AsyncSession, symbol: str) -> Ticker:
|
||||
@@ -219,9 +219,9 @@ async def scan_ticker(
|
||||
) -> list[TradeSetup]:
|
||||
"""Scan a single ticker for trade setups meeting the R:R threshold.
|
||||
|
||||
``momentum_percentile`` is the ticker's 12-1 momentum rank across the universe
|
||||
(computed by the caller), stored on each setup so the activation gate can
|
||||
select the top slice."""
|
||||
``momentum_percentile`` is the ticker's residual 12-1 momentum activation
|
||||
rank across the universe (computed by the caller), stored on each setup so
|
||||
the activation gate can select the top slice."""
|
||||
ticker = await _get_ticker(db, symbol)
|
||||
|
||||
records = await query_ohlcv(db, symbol)
|
||||
@@ -393,8 +393,9 @@ async def scan_all_tickers(
|
||||
tickers = list(result.scalars().all())
|
||||
total = len(tickers)
|
||||
|
||||
# Rank the universe by 12-1 momentum up front so each new setup carries its
|
||||
# ticker's percentile (used by the activation gate). Best-effort.
|
||||
# Rank the universe by residual 12-1 momentum up front so each new setup
|
||||
# carries its activation percentile. Best-effort; the ranker falls back to
|
||||
# raw 12-1 momentum only if benchmark data is unavailable.
|
||||
try:
|
||||
from app.services import momentum_service
|
||||
|
||||
|
||||
Reference in New Issue
Block a user