Compare commits

..
2 changed files with 29 additions and 34 deletions
@@ -1,15 +1,14 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# EXP 14 - Strategy A (baseline): reference model + TopkDropout. # EXP 15 - Strategy A (baseline): parallel reference model + TopkDropout.
# #
# Model = RankICEnsembleLGBModel (5-seed RankIC-early-stopped LGB), the class # Model = RankICEnsembleLGBModel with PARALLEL=5 (thread-pool seed training,
# wired by the tac-rd-rank-ensemble-isolated reference (run 0cea66d9...). # rank_ensemble.py) - the speedup means the 5-seed 3000-round ensemble trains in
# Strategy = TopkDropout topk=10 n_drop=2 risk_degree=0.95 (the reference's own # ~1/5th the wall time of the serial reference. Strategy = TopkDropout topk=10
# recorded backtest strategy), so this run reproduces the reference baseline on # n_drop=2 risk_degree=0.95 (the reference's recorded strategy).
# the same 50-ETF SP-5d panel.
# #
# Run: # Run:
# rd_run_workflow config_path=experiments/workflows/exp14-optstop-v2/a_topk_baseline.yaml \ # rd_run_workflow config_path=experiments/workflows/exp15-kelly-size/a_topk_baseline.yaml \
# experiment_name=tac-rd-optstop-v2 # experiment_name=tac-rd-kelly-size
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
{%- 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" %}
@@ -43,7 +42,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-optstop-v2" default_exp_name: "tac-rd-kelly-size"
task: task:
model: model:
@@ -64,6 +63,7 @@ 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,21 +1,18 @@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# EXP 14 - Strategy B (enhanced): reference model + OptimalStopControlV2. # EXP 15 - Strategy B: parallel reference model + KellyWeightStrategy.
# #
# Model = RankICEnsembleLGBModel (5-seed RankIC-early-stopped LGB), identical to # Model = RankICEnsembleLGBModel PARALLEL=5 (same as A). Strategy =
# Strategy A. Strategy = OptimalStopControlV2 (tac_qlib.contrib.strategy. # KellyWeightStrategy (tac_qlib.contrib.strategy.kelly_weight): applies the
# optimal_stop_v2) with the controls that address OptimalStopControl's documented # Kelly criterion to position SIZING -
# weaknesses: # f* = kelly_fraction * mu_i / var_i (Gaussian Kelly, mu_i > 0)
# - turnover / cost control: rebalance_band=0.05 (skip small rebalances), # with per-name mu/var estimated from the rolling signal history (no
# cooldown_days=3 (no whipsaw re-entries), max_turnover=0.30 (cap daily # lookahead), floored/capped and normalized to the risk_degree leverage budget.
# traded notional, priority exits > opens > rebalances) # This is the piece the reference's equal-weight TopkDropout never tunes: it
# - robust thresholds (no valid-window overfit): entry 0.85 / exit 0.70 / # weights names by edge/risk instead of equal-weight top-k.
# 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/exp14-optstop-v2/b_optstop_v2.yaml \ # rd_run_workflow config_path=experiments/workflows/exp15-kelly-size/b_kelly_weight.yaml \
# experiment_name=tac-rd-optstop-v2 # experiment_name=tac-rd-kelly-size
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
{%- 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" %}
@@ -49,7 +46,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-optstop-v2" default_exp_name: "tac-rd-kelly-size"
task: task:
model: model:
@@ -70,6 +67,7 @@ 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
@@ -119,20 +117,17 @@ task:
kwargs: kwargs:
config: config:
strategy: strategy:
class: OptimalStopControlV2 class: KellyWeightStrategy
module_path: tac_qlib.contrib.strategy.optimal_stop_v2 module_path: tac_qlib.contrib.strategy.kelly_weight
kwargs: kwargs:
signal: "<PRED>" signal: "<PRED>"
topk: 10 topk: 10
entry_pct: 0.85 lookback: 20
exit_pct: 0.70 min_obs: 10
max_hold_days: 10 kelly_fraction: 0.5
min_hold_days: 2 max_weight: 0.15
sl: -0.08 min_weight: 0.0
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