Compare commits

..
2 changed files with 34 additions and 29 deletions
@@ -1,14 +1,15 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# EXP 15 - Strategy A (baseline): parallel reference model + TopkDropout. # EXP 14 - Strategy A (baseline): reference model + TopkDropout.
# #
# Model = RankICEnsembleLGBModel with PARALLEL=5 (thread-pool seed training, # Model = RankICEnsembleLGBModel (5-seed RankIC-early-stopped LGB), the class
# rank_ensemble.py) - the speedup means the 5-seed 3000-round ensemble trains in # wired by the tac-rd-rank-ensemble-isolated reference (run 0cea66d9...).
# ~1/5th the wall time of the serial reference. Strategy = TopkDropout topk=10 # Strategy = TopkDropout topk=10 n_drop=2 risk_degree=0.95 (the reference's own
# n_drop=2 risk_degree=0.95 (the reference's recorded strategy). # recorded backtest strategy), so this run reproduces the reference baseline on
# the same 50-ETF SP-5d panel.
# #
# Run: # Run:
# rd_run_workflow config_path=experiments/workflows/exp15-kelly-size/a_topk_baseline.yaml \ # rd_run_workflow config_path=experiments/workflows/exp14-optstop-v2/a_topk_baseline.yaml \
# experiment_name=tac-rd-kelly-size # experiment_name=tac-rd-optstop-v2
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
{%- set LAKE = TAC_LAKE_DIR %} {%- set LAKE = TAC_LAKE_DIR %}
{%- set UNIVERSE = "SPY,QQQ,DIA,IWM,MDY,VTI,VOO,VEA,VWO,VT,EFA,EEM,TLT,IEF,SHY,AGG,BND,LQD,HYG,JNK,EMB,GLD,SLV,USO,UNG,DBA,DBC,XLK,XLF,XLE,XLV,XLI,XLY,XLP,XLU,XLB,XLRE,ARKK,SMH,SOXX,IBB,XBI,ITA,XAR,ICLN,TAN,FDN,IGV,ESPO,REM" %} {%- set UNIVERSE = "SPY,QQQ,DIA,IWM,MDY,VTI,VOO,VEA,VWO,VT,EFA,EEM,TLT,IEF,SHY,AGG,BND,LQD,HYG,JNK,EMB,GLD,SLV,USO,UNG,DBA,DBC,XLK,XLF,XLE,XLV,XLI,XLY,XLP,XLU,XLB,XLRE,ARKK,SMH,SOXX,IBB,XBI,ITA,XAR,ICLN,TAN,FDN,IGV,ESPO,REM" %}
@@ -42,7 +43,7 @@ qlib_init:
module_path: qlib.workflow.expm module_path: qlib.workflow.expm
kwargs: kwargs:
uri: "sqlite:///{{ LAKE }}/mlruns.db" uri: "sqlite:///{{ LAKE }}/mlruns.db"
default_exp_name: "tac-rd-kelly-size" default_exp_name: "tac-rd-optstop-v2"
task: task:
model: model:
@@ -63,7 +64,6 @@ task:
reg_alpha: 0.1 reg_alpha: 0.1
reg_lambda: 1.0 reg_lambda: 1.0
seeds: "42,7,2026,99,123" seeds: "42,7,2026,99,123"
parallel: 5
dataset: dataset:
class: DatasetH class: DatasetH
@@ -1,18 +1,21 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# EXP 15 - Strategy B: parallel reference model + KellyWeightStrategy. # EXP 14 - Strategy B (enhanced): reference model + OptimalStopControlV2.
# #
# Model = RankICEnsembleLGBModel PARALLEL=5 (same as A). Strategy = # Model = RankICEnsembleLGBModel (5-seed RankIC-early-stopped LGB), identical to
# KellyWeightStrategy (tac_qlib.contrib.strategy.kelly_weight): applies the # Strategy A. Strategy = OptimalStopControlV2 (tac_qlib.contrib.strategy.
# Kelly criterion to position SIZING - # optimal_stop_v2) with the controls that address OptimalStopControl's documented
# f* = kelly_fraction * mu_i / var_i (Gaussian Kelly, mu_i > 0) # weaknesses:
# with per-name mu/var estimated from the rolling signal history (no # - turnover / cost control: rebalance_band=0.05 (skip small rebalances),
# lookahead), floored/capped and normalized to the risk_degree leverage budget. # cooldown_days=3 (no whipsaw re-entries), max_turnover=0.30 (cap daily
# This is the piece the reference's equal-weight TopkDropout never tunes: it # traded notional, priority exits > opens > rebalances)
# weights names by edge/risk instead of equal-weight top-k. # - robust thresholds (no valid-window overfit): entry 0.85 / exit 0.70 /
# max_hold 10 / min_hold 2 / sl -0.08
# Sizing = equal-weight control (risk_degree fraction of total value split
# across targets) - the "proper allocation" that replaces cash-heuristic sizing.
# #
# Run: # Run:
# rd_run_workflow config_path=experiments/workflows/exp15-kelly-size/b_kelly_weight.yaml \ # rd_run_workflow config_path=experiments/workflows/exp14-optstop-v2/b_optstop_v2.yaml \
# experiment_name=tac-rd-kelly-size # experiment_name=tac-rd-optstop-v2
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
{%- set LAKE = TAC_LAKE_DIR %} {%- set LAKE = TAC_LAKE_DIR %}
{%- set UNIVERSE = "SPY,QQQ,DIA,IWM,MDY,VTI,VOO,VEA,VWO,VT,EFA,EEM,TLT,IEF,SHY,AGG,BND,LQD,HYG,JNK,EMB,GLD,SLV,USO,UNG,DBA,DBC,XLK,XLF,XLE,XLV,XLI,XLY,XLP,XLU,XLB,XLRE,ARKK,SMH,SOXX,IBB,XBI,ITA,XAR,ICLN,TAN,FDN,IGV,ESPO,REM" %} {%- set UNIVERSE = "SPY,QQQ,DIA,IWM,MDY,VTI,VOO,VEA,VWO,VT,EFA,EEM,TLT,IEF,SHY,AGG,BND,LQD,HYG,JNK,EMB,GLD,SLV,USO,UNG,DBA,DBC,XLK,XLF,XLE,XLV,XLI,XLY,XLP,XLU,XLB,XLRE,ARKK,SMH,SOXX,IBB,XBI,ITA,XAR,ICLN,TAN,FDN,IGV,ESPO,REM" %}
@@ -46,7 +49,7 @@ qlib_init:
module_path: qlib.workflow.expm module_path: qlib.workflow.expm
kwargs: kwargs:
uri: "sqlite:///{{ LAKE }}/mlruns.db" uri: "sqlite:///{{ LAKE }}/mlruns.db"
default_exp_name: "tac-rd-kelly-size" default_exp_name: "tac-rd-optstop-v2"
task: task:
model: model:
@@ -67,7 +70,6 @@ task:
reg_alpha: 0.1 reg_alpha: 0.1
reg_lambda: 1.0 reg_lambda: 1.0
seeds: "42,7,2026,99,123" seeds: "42,7,2026,99,123"
parallel: 5
dataset: dataset:
class: DatasetH class: DatasetH
@@ -117,17 +119,20 @@ task:
kwargs: kwargs:
config: config:
strategy: strategy:
class: KellyWeightStrategy class: OptimalStopControlV2
module_path: tac_qlib.contrib.strategy.kelly_weight module_path: tac_qlib.contrib.strategy.optimal_stop_v2
kwargs: kwargs:
signal: "<PRED>" signal: "<PRED>"
topk: 10 topk: 10
lookback: 20 entry_pct: 0.85
min_obs: 10 exit_pct: 0.70
kelly_fraction: 0.5 max_hold_days: 10
max_weight: 0.15 min_hold_days: 2
min_weight: 0.0 sl: -0.08
risk_degree: 0.95 risk_degree: 0.95
notional: 20000
rebalance_band: 0.05
cooldown_days: 3
max_turnover: 0.30 max_turnover: 0.30
backtest: backtest:
start_time: 2026-01-04 start_time: 2026-01-04