Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Shiyu coder Kronos Topk Dropout Portfolio Strategy

From Leeroopedia


Field Value
Principle Name Topk_Dropout_Portfolio_Strategy
Repository Shiyu_coder_Kronos
Repository URL https://github.com/shiyu-coder/Kronos
Domains Portfolio_Management, Trading_Strategy, Quantitative_Finance
Implemented By Implementation:Shiyu_coder_Kronos_TopkDropoutStrategy_Usage
Last Updated 2026-02-09 14:00 GMT

Overview

This principle describes a portfolio construction strategy that selects top-k stocks by predicted signal score while randomly dropping a fraction of held positions to reduce turnover and improve robustness. It is used in the Kronos backtesting pipeline to evaluate the quality of model predictions as trading signals.

Concept

At each rebalancing step, the strategy:

  1. Ranks all stocks by their prediction signal score (higher = more bullish)
  2. Selects the top-k highest-scoring stocks as candidates
  3. Randomly drops n_drop positions from the currently held portfolio
  4. Replaces dropped positions with the next-highest scored stocks not currently held

This mechanism balances between maintaining high-conviction positions and introducing controlled exploration.

Theory

Top-K Selection

The base approach is straightforward: rank all available stocks by their predicted signal (e.g., predicted future return or price change) and hold positions in the top-k stocks. This creates a concentrated portfolio of the model's highest-conviction picks.

Dropout Mechanism

Pure top-k selection suffers from several issues:

  • High turnover: Small changes in prediction scores near the k-th rank boundary can cause frequent position changes, leading to excessive trading costs.
  • Concentration risk: The portfolio can become overly concentrated in a few sectors or correlated stocks.
  • Overfitting to signal noise: Minor prediction errors near the boundary get amplified into trading decisions.

The dropout mechanism addresses these by randomly removing n_drop positions from the current portfolio at each rebalancing step. This:

  • Reduces turnover: Positions that would otherwise be marginally replaced are sometimes retained.
  • Introduces exploration: New stocks just outside the top-k get a chance to enter the portfolio.
  • Improves robustness: The strategy is less sensitive to small fluctuations in prediction scores.

Hold Threshold

The hold_thresh parameter specifies the minimum holding period for a stock. Positions held for fewer than hold_thresh periods are protected from dropout, preventing excessive short-term trading.

Strategy Parameters

Parameter Typical Value Description
topk 50 Number of stocks to hold in the portfolio
n_drop 5 Number of positions to randomly drop at each rebalance
hold_thresh 5 Minimum holding period (in time steps) before a position is eligible for dropout
signal pd.Series Prediction scores as a MultiIndex Series (instrument, datetime)

Application in Kronos

In the Kronos backtesting pipeline (finetune/qlib_test.py), TopkDropoutStrategy is used to convert model prediction signals into portfolio allocation decisions. The prediction signals are generated by running Kronos inference over a test dataset, producing predicted close price changes for each stock at each time step.

The strategy is combined with the Qlib backtesting framework to simulate realistic trading with:

  • Daily rebalancing frequency
  • Transaction costs (open_cost=0.1%, close_cost=0.15%, min_cost=5)
  • Price limit thresholds (9.5%)
  • Starting capital of 100,000,000

See Also

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment