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