From 394aa5abcd17bab6ffe3e0a2212db2247030b896 Mon Sep 17 00:00:00 2001 From: Akshay Kumar Date: Thu, 20 Aug 2026 22:56:51 +0530 Subject: [PATCH] fix(strategy): use get_risk_degree() in TopkDropoutStrategy for position sizing --- qlib/contrib/strategy/signal_strategy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/contrib/strategy/signal_strategy.py b/qlib/contrib/strategy/signal_strategy.py index bad19ddfdc9..5397827acd8 100644 --- a/qlib/contrib/strategy/signal_strategy.py +++ b/qlib/contrib/strategy/signal_strategy.py @@ -263,7 +263,7 @@ def filter_stock(li): # buy new stock # note the current has been changed # current_stock_list = current_temp.get_stock_list() - value = cash * self.risk_degree / len(buy) if len(buy) > 0 else 0 + value = cash * self.get_risk_degree(trade_step) / len(buy) if len(buy) > 0 else 0 # open_cost should be considered in the real trading environment, while the backtest in evaluate.py does not # consider it as the aim of demo is to accomplish same strategy as evaluate.py, so comment out this line