Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02091341b5 | ||
|
|
adc685d9cf |
+1
-1
@@ -1,5 +1,5 @@
|
||||
# TradeAC custom-qlib-code snapshot (auto-generated)
|
||||
# parent repo HEAD : 507846cee16eeee11daf33c4176e8aec79b985b2
|
||||
# parent repo HEAD : adc685d9cfe7556ef314cc9dc7c7bccb482aa2f8
|
||||
# tac-qlib/tac_qlib/contrib
|
||||
# tac-qlib/tac_qlib/data
|
||||
# per-file hashes (git hash-object):
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Q08 — Risk-limit A/B re-validation (trace 40)
|
||||
|
||||
**Status:** DONE (verdict: REFUTED as an IR edge; safety-net value retained)
|
||||
|
||||
## Input
|
||||
- Reference signal: exp-26 pred, run `21afc6afdb674a399b59dd76c97628ce` (mlflow exp 25)
|
||||
- Window: 2026-01-04 → 2026-08-10, Topk10 n_drop1, SPY benchmark, $1M, 5/15bp/$5
|
||||
- Tool: `rd_risk_calibrate` (A/B + sensitivity grid). Full JSON: `risk_calibration.json`
|
||||
|
||||
## Candidate spec (round-3 live spec)
|
||||
`{"liquidity_floor_adv": 5000000, "size_cap_pct": 0.12, "concentration_cap_pct": 0.95, "drawdown_pause_pct": 0.10}`
|
||||
|
||||
## Results (net, with cost)
|
||||
| Config | IR | Ann. return | Max DD |
|
||||
|---|---|---|---|
|
||||
| baseline (no limits) | 1.5804 | +27.50% | −6.91% |
|
||||
| **candidate (5M floor + caps)** | **1.5121** | +2.20% | **−0.65%** |
|
||||
| liquidity $10M | 1.5457 | +2.25% | −0.64% |
|
||||
|
||||
## Findings
|
||||
- **Floor binds, not a no-op**: $5M liquidity floor dropped 8 symbols —
|
||||
`DBA, DBC, ESPO, FDN, REM, TAN, UNG, XAR`.
|
||||
- **No IR edge from the gate**: candidate IR (1.512) is BELOW baseline (1.580).
|
||||
The exp-18 direction (floor IR 0.81→0.98) does NOT reproduce on the clean-lake
|
||||
reference signal.
|
||||
- **Drawdown cut is pure defunding**: size_cap 0.12 × concentration 0.95 fold
|
||||
the effective risk_degree to ~0.0095 → ~$9.5k deployed of $1M (~100x less).
|
||||
Sensitivity grid shows both caps are no-ops (conc 20–50% identical,
|
||||
size_cap 5–20% identical); only the liquidity floor moves returns, marginally.
|
||||
- **Conclusion**: keep the live spec as a safety net; there is no risk-limit
|
||||
gate IR edge to harvest when the signal is the bottleneck (exp-20 pattern).
|
||||
|
||||
## Artifacts on this branch
|
||||
- `evidence/q08-risklimit/risk_calibration.json` — full calibration dump
|
||||
- `queue/designs/q08_risk_limit_ab.md` — the pre-registered design doc
|
||||
@@ -1,401 +0,0 @@
|
||||
{
|
||||
"rows": [
|
||||
{
|
||||
"label": "baseline (no limits)",
|
||||
"mean": 0.001155,
|
||||
"std": 0.011279,
|
||||
"annualized_return": 0.274989,
|
||||
"information_ratio": 1.580427,
|
||||
"max_drawdown": -0.069145
|
||||
},
|
||||
{
|
||||
"label": "liquidity $10,000,000",
|
||||
"mean": 9.4e-05,
|
||||
"std": 0.000942,
|
||||
"annualized_return": 0.022464,
|
||||
"information_ratio": 1.545736,
|
||||
"max_drawdown": -0.006389
|
||||
},
|
||||
{
|
||||
"label": "conc 20%",
|
||||
"mean": 0.000115,
|
||||
"std": 0.001168,
|
||||
"annualized_return": 0.027285,
|
||||
"information_ratio": 1.513718,
|
||||
"max_drawdown": -0.008104
|
||||
},
|
||||
{
|
||||
"label": "conc 30%",
|
||||
"mean": 0.000115,
|
||||
"std": 0.001168,
|
||||
"annualized_return": 0.027285,
|
||||
"information_ratio": 1.513718,
|
||||
"max_drawdown": -0.008104
|
||||
},
|
||||
{
|
||||
"label": "conc 40%",
|
||||
"mean": 0.000115,
|
||||
"std": 0.001168,
|
||||
"annualized_return": 0.027285,
|
||||
"information_ratio": 1.513718,
|
||||
"max_drawdown": -0.008104
|
||||
},
|
||||
{
|
||||
"label": "conc 50%",
|
||||
"mean": 0.000115,
|
||||
"std": 0.001168,
|
||||
"annualized_return": 0.027285,
|
||||
"information_ratio": 1.513718,
|
||||
"max_drawdown": -0.008104
|
||||
},
|
||||
{
|
||||
"label": "candidate {\"liquidity_floor_adv\": 5000000.0, \"size_cap_pct\": 0.12, \"concentration_cap_pct\": 0.95, \"drawdown_pause_pct\": 0.1}",
|
||||
"mean": 9.2e-05,
|
||||
"std": 0.000943,
|
||||
"annualized_return": 0.021991,
|
||||
"information_ratio": 1.512051,
|
||||
"max_drawdown": -0.00653
|
||||
},
|
||||
{
|
||||
"label": "size_cap 5%",
|
||||
"mean": 9.2e-05,
|
||||
"std": 0.000943,
|
||||
"annualized_return": 0.021991,
|
||||
"information_ratio": 1.512051,
|
||||
"max_drawdown": -0.00653
|
||||
},
|
||||
{
|
||||
"label": "size_cap 10%",
|
||||
"mean": 9.2e-05,
|
||||
"std": 0.000943,
|
||||
"annualized_return": 0.021991,
|
||||
"information_ratio": 1.512051,
|
||||
"max_drawdown": -0.00653
|
||||
},
|
||||
{
|
||||
"label": "size_cap 15%",
|
||||
"mean": 9.2e-05,
|
||||
"std": 0.000943,
|
||||
"annualized_return": 0.021991,
|
||||
"information_ratio": 1.512051,
|
||||
"max_drawdown": -0.00653
|
||||
},
|
||||
{
|
||||
"label": "size_cap 20%",
|
||||
"mean": 9.2e-05,
|
||||
"std": 0.000943,
|
||||
"annualized_return": 0.021991,
|
||||
"information_ratio": 1.512051,
|
||||
"max_drawdown": -0.00653
|
||||
},
|
||||
{
|
||||
"label": "liquidity $5,000,000",
|
||||
"mean": 9.2e-05,
|
||||
"std": 0.000943,
|
||||
"annualized_return": 0.021991,
|
||||
"information_ratio": 1.512051,
|
||||
"max_drawdown": -0.00653
|
||||
},
|
||||
{
|
||||
"label": "liquidity $1,000,000",
|
||||
"mean": 9.1e-05,
|
||||
"std": 0.000929,
|
||||
"annualized_return": 0.021625,
|
||||
"information_ratio": 1.508748,
|
||||
"max_drawdown": -0.006376
|
||||
},
|
||||
{
|
||||
"label": "liquidity $2,500,000",
|
||||
"mean": 7.1e-05,
|
||||
"std": 0.000918,
|
||||
"annualized_return": 0.017,
|
||||
"information_ratio": 1.199721,
|
||||
"max_drawdown": -0.007158
|
||||
}
|
||||
],
|
||||
"runs": {
|
||||
"baseline": {
|
||||
"risk": {
|
||||
"mean": 0.0011554172081987572,
|
||||
"std": 0.01127853762493476,
|
||||
"annualized_return": 0.27498929555130425,
|
||||
"information_ratio": 1.5804272791471323,
|
||||
"max_drawdown": -0.06914515336341577
|
||||
},
|
||||
"applied": {}
|
||||
},
|
||||
"candidate": {
|
||||
"risk": {
|
||||
"mean": 9.239707947451976e-05,
|
||||
"std": 0.0009427144352738658,
|
||||
"annualized_return": 0.0219905049149357,
|
||||
"information_ratio": 1.5120514373488407,
|
||||
"max_drawdown": -0.006530482262119444
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"size_cap 5%": {
|
||||
"risk": {
|
||||
"mean": 9.239707947451976e-05,
|
||||
"std": 0.0009427144352738658,
|
||||
"annualized_return": 0.0219905049149357,
|
||||
"information_ratio": 1.5120514373488407,
|
||||
"max_drawdown": -0.006530482262119444
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"size_cap 10%": {
|
||||
"risk": {
|
||||
"mean": 9.239707947451976e-05,
|
||||
"std": 0.0009427144352738658,
|
||||
"annualized_return": 0.0219905049149357,
|
||||
"information_ratio": 1.5120514373488407,
|
||||
"max_drawdown": -0.006530482262119444
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"size_cap 15%": {
|
||||
"risk": {
|
||||
"mean": 9.239707947451976e-05,
|
||||
"std": 0.0009427144352738658,
|
||||
"annualized_return": 0.0219905049149357,
|
||||
"information_ratio": 1.5120514373488407,
|
||||
"max_drawdown": -0.006530482262119444
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"size_cap 20%": {
|
||||
"risk": {
|
||||
"mean": 9.239707947451976e-05,
|
||||
"std": 0.0009427144352738658,
|
||||
"annualized_return": 0.0219905049149357,
|
||||
"information_ratio": 1.5120514373488407,
|
||||
"max_drawdown": -0.006530482262119444
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"conc 20%": {
|
||||
"risk": {
|
||||
"mean": 0.00011464156491316718,
|
||||
"std": 0.0011683839517000441,
|
||||
"annualized_return": 0.027284692449333788,
|
||||
"information_ratio": 1.5137180903503433,
|
||||
"max_drawdown": -0.008103887185240407
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"conc 30%": {
|
||||
"risk": {
|
||||
"mean": 0.00011464156491316718,
|
||||
"std": 0.0011683839517000441,
|
||||
"annualized_return": 0.027284692449333788,
|
||||
"information_ratio": 1.5137180903503433,
|
||||
"max_drawdown": -0.008103887185240407
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"conc 40%": {
|
||||
"risk": {
|
||||
"mean": 0.00011464156491316718,
|
||||
"std": 0.0011683839517000441,
|
||||
"annualized_return": 0.027284692449333788,
|
||||
"information_ratio": 1.5137180903503433,
|
||||
"max_drawdown": -0.008103887185240407
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"conc 50%": {
|
||||
"risk": {
|
||||
"mean": 0.00011464156491316718,
|
||||
"std": 0.0011683839517000441,
|
||||
"annualized_return": 0.027284692449333788,
|
||||
"information_ratio": 1.5137180903503433,
|
||||
"max_drawdown": -0.008103887185240407
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"liquidity $1,000,000": {
|
||||
"risk": {
|
||||
"mean": 9.086210454881382e-05,
|
||||
"std": 0.0009290831160004576,
|
||||
"annualized_return": 0.021625180882617688,
|
||||
"information_ratio": 1.508747982736451,
|
||||
"max_drawdown": -0.006376134679664126
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"ESPO"
|
||||
]
|
||||
}
|
||||
},
|
||||
"liquidity $2,500,000": {
|
||||
"risk": {
|
||||
"mean": 7.142665167642606e-05,
|
||||
"std": 0.0009184775632266332,
|
||||
"annualized_return": 0.016999543098989402,
|
||||
"information_ratio": 1.1997208834083914,
|
||||
"max_drawdown": -0.0071582979845040825
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"REM",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"liquidity $5,000,000": {
|
||||
"risk": {
|
||||
"mean": 9.239707947451976e-05,
|
||||
"std": 0.0009427144352738658,
|
||||
"annualized_return": 0.0219905049149357,
|
||||
"information_ratio": 1.5120514373488407,
|
||||
"max_drawdown": -0.006530482262119444
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"REM",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
},
|
||||
"liquidity $10,000,000": {
|
||||
"risk": {
|
||||
"mean": 9.438545151345752e-05,
|
||||
"std": 0.0009420158170657147,
|
||||
"annualized_return": 0.02246373746020289,
|
||||
"information_ratio": 1.5457360696934006,
|
||||
"max_drawdown": -0.006388809561209335
|
||||
},
|
||||
"applied": {
|
||||
"dropped_liquidity": [
|
||||
"DBA",
|
||||
"DBC",
|
||||
"ESPO",
|
||||
"FDN",
|
||||
"ICLN",
|
||||
"ITA",
|
||||
"MDY",
|
||||
"REM",
|
||||
"SHY",
|
||||
"TAN",
|
||||
"UNG",
|
||||
"XAR"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"candidate": {
|
||||
"liquidity_floor_adv": 5000000.0,
|
||||
"size_cap_pct": 0.12,
|
||||
"concentration_cap_pct": 0.95,
|
||||
"drawdown_pause_pct": 0.1
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
# QUEUE-08 — Risk-limit A/B re-validation: $5M liquidity floor on the exp-26 reference
|
||||
|
||||
**Status:** QUEUED · **Priority:** P1 · **Effort:** tool-only (no new code)
|
||||
|
||||
## Hypothesis (prove)
|
||||
The $5M liquidity floor improves net IR and cuts drawdown on the **post-reset**
|
||||
reference signal (pre-reset exp 18, EVIDENCE#008: net IR 0.81→0.98, cumDD
|
||||
7.93%→5.44%), while size/concentration caps hurt by cutting deployed capital.
|
||||
Needs re-validation on the exp-26 lineage because exp 18 is pre-clean-lake and
|
||||
not comparable (EVIDENCE#009/010). Source: `book/CLAIMS.md` open question +
|
||||
`book/README.md` `TODO(evidence-needed: reconciliation of exp 18 risk-limit spec
|
||||
on the post-reset reference signal)`.
|
||||
|
||||
## Change vs exp-26 reference (ONE variable)
|
||||
- Reference: the saved exp-26 prediction (run `21afc6af…`, mlflow exp 25).
|
||||
- A/B via `rd_risk_calibrate` (runs limit-vs-no-limit A/B + sensitivity grid
|
||||
over size_cap_pct, concentration_cap_pct, liquidity_floor_adv) and/or
|
||||
`rd_backtest` with `risk_limits` on the SAME saved `pred.pkl`:
|
||||
- baseline: no limits (this must reproduce the exp-26 net +2.13% / IR 0.21);
|
||||
- candidate: `{"liquidity_floor_adv": 5000000, "size_cap_pct": 0.12,
|
||||
"concentration_cap_pct": 0.95, "drawdown_pause_pct": 0.10}` (round-3 spec).
|
||||
- Pick the spec (B2 calibration) that keeps live ≈ backtest.
|
||||
|
||||
## Acceptance
|
||||
- Candidate spec: `net_IR > 0.21` AND `net_max_drawdown < 7.69%` vs no-limit on
|
||||
the same pred. Size/concentration caps expected to REDUCE deployed capital
|
||||
(record the direction as confirmation of exp 18).
|
||||
- If the floor is a no-op (gates don't bind at this signal) → report that gates
|
||||
are no-ops when the signal is the bottleneck (exp 20 pattern) as a PROVEN
|
||||
clean-lake result.
|
||||
|
||||
## Execution prerequisites
|
||||
- None (uses saved pred + `rd_risk_calibrate`/`rd_backtest`). Trace the A/B as
|
||||
an experiment; record the spec chosen for the next live round.
|
||||
@@ -1,133 +0,0 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# ABLATION A (baseline): LightGBM with RankIC early-stopping on the 50-ETF SP-5d
|
||||
# panel, using ALL 24 sp_* feature columns (ou,hmm,jump,har,trend,hurst,
|
||||
# signature). Copy of the canonical workflow_lgb_sp5d_rankic.yaml with a
|
||||
# distinct experiment name so the ablation runs are isolated.
|
||||
#
|
||||
# Run:
|
||||
# rd_run_workflow config_path=tac-qlib/workflows/ablate_baseline_all_sp_fields.yaml \
|
||||
# experiment_name=tac-rd-rank-ablate
|
||||
# -----------------------------------------------------------------------------
|
||||
{%- 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 SP_FIELDS = "sp_ret,sp_ou_zscore,sp_ou_half_life,sp_ou_revert,sp_hmm_p_regime1,sp_hmm_state,sp_jump_ratio,sp_jump_flag,sp_jump_tail,sp_max_move,sp_rv1,sp_rv5,sp_rv22,sp_vol_ratio_5_22,sp_vol_ratio_1_22,sp_trend_slope_5,sp_trend_slope_20,sp_trend_slope_60,sp_logp,sp_hurst_exponent,sp_sig_level1_lead,sp_sig_level1_lag,sp_sig_level2_lead_lag,sp_sig_level2_lag_lead" %}
|
||||
|
||||
qlib_init:
|
||||
provider_uri: "{{ LAKE }}"
|
||||
region: us
|
||||
expression_cache: null
|
||||
dataset_cache: null
|
||||
|
||||
calendar_provider:
|
||||
class: tac_qlib.data.providers.LakeCalendarProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
instrument_provider:
|
||||
class: tac_qlib.data.providers.LakeInstrumentProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
markets: {}
|
||||
feature_provider:
|
||||
class: tac_qlib.data.providers.LakeFeatureProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
|
||||
exp_manager:
|
||||
class: MLflowExpManager
|
||||
module_path: qlib.workflow.expm
|
||||
kwargs:
|
||||
uri: "sqlite:///{{ LAKE }}/mlruns.db"
|
||||
default_exp_name: "tac-rd-rank-ablate"
|
||||
|
||||
task:
|
||||
model:
|
||||
class: RankICLGBModel
|
||||
module_path: tac_qlib.contrib.model.rank_gbdt
|
||||
kwargs:
|
||||
loss: mse
|
||||
learning_rate: 0.02
|
||||
num_leaves: 31
|
||||
n_estimators: 3000
|
||||
num_boost_round: 3000
|
||||
early_stopping_rounds: 200
|
||||
min_data_in_leaf: 20
|
||||
lambda_l2: 0.5
|
||||
colsample_bytree: 0.8
|
||||
subsample: 0.8
|
||||
subsample_freq: 1
|
||||
reg_alpha: 0.1
|
||||
reg_lambda: 1.0
|
||||
seed: 42
|
||||
|
||||
dataset:
|
||||
class: DatasetH
|
||||
module_path: qlib.data.dataset
|
||||
kwargs:
|
||||
handler:
|
||||
class: TACHandler
|
||||
module_path: tac_qlib.contrib.data.handler
|
||||
kwargs:
|
||||
instruments: "{{ UNIVERSE }}"
|
||||
start_time: 2015-01-03
|
||||
end_time: 2026-08-10
|
||||
fit_start_time: 2015-01-03
|
||||
fit_end_time: 2025-09-01
|
||||
freq: day
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
label: "Ref($close,-6)/Ref($close,-1)-1"
|
||||
feature_fields: "$open,$high,$low,$close,$vwap,$volume,{{ SP_FIELDS }}"
|
||||
infer_processors:
|
||||
- class: DropAllNaN
|
||||
kwargs: {}
|
||||
- class: ProcessInf
|
||||
kwargs: {}
|
||||
- class: CSRankNorm
|
||||
kwargs: {}
|
||||
- class: ZScoreNorm
|
||||
kwargs: {}
|
||||
- class: Fillna
|
||||
kwargs: {}
|
||||
segments:
|
||||
train: [2015-01-03, 2025-09-01]
|
||||
valid: [2025-09-03, 2026-01-03]
|
||||
test: [2026-01-04, 2026-08-10]
|
||||
|
||||
record:
|
||||
- class: SignalRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs: {}
|
||||
- class: SigAnaRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs:
|
||||
ana_long_short: true
|
||||
ann_scaler: 252
|
||||
- class: PortAnaRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs:
|
||||
config:
|
||||
strategy:
|
||||
class: TopkDropoutStrategy
|
||||
module_path: qlib.contrib.strategy
|
||||
kwargs:
|
||||
signal: "<PRED>"
|
||||
topk: 10
|
||||
n_drop: 2
|
||||
only_tradable: true
|
||||
risk_degree: 0.95
|
||||
backtest:
|
||||
start_time: 2026-01-04
|
||||
end_time: 2026-08-10
|
||||
account: 1000000
|
||||
benchmark: SPY
|
||||
exchange_kwargs:
|
||||
codes: "{{ UNIVERSE }}"
|
||||
deal_price: $close
|
||||
freq: day
|
||||
open_cost: 0.0005
|
||||
close_cost: 0.0015
|
||||
min_cost: 5.0
|
||||
risk_analysis_freq: 1d
|
||||
@@ -1,134 +0,0 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# ABLATION B (generic-only): same panel/model as the baseline, but feature
|
||||
# fields restricted to the model-free / generic stochastic-process families
|
||||
# (jump,har,trend,hurst,signature). Drops the model-specific ou (OU/AR-1
|
||||
# half-life) and hmm (2-state regime) families to test whether the generic
|
||||
# families alone dominate the rank dimension.
|
||||
#
|
||||
# Run:
|
||||
# rd_run_workflow config_path=tac-qlib/workflows/ablate_generic_only_sp_fields.yaml \
|
||||
# experiment_name=tac-rd-rank-ablate
|
||||
# -----------------------------------------------------------------------------
|
||||
{%- 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 SP_FIELDS = "sp_ret,sp_jump_ratio,sp_jump_flag,sp_jump_tail,sp_max_move,sp_rv1,sp_rv5,sp_rv22,sp_vol_ratio_5_22,sp_vol_ratio_1_22,sp_trend_slope_5,sp_trend_slope_20,sp_trend_slope_60,sp_logp,sp_hurst_exponent,sp_sig_level1_lead,sp_sig_level1_lag,sp_sig_level2_lead_lag,sp_sig_level2_lag_lead" %}
|
||||
|
||||
qlib_init:
|
||||
provider_uri: "{{ LAKE }}"
|
||||
region: us
|
||||
expression_cache: null
|
||||
dataset_cache: null
|
||||
|
||||
calendar_provider:
|
||||
class: tac_qlib.data.providers.LakeCalendarProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
instrument_provider:
|
||||
class: tac_qlib.data.providers.LakeInstrumentProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
markets: {}
|
||||
feature_provider:
|
||||
class: tac_qlib.data.providers.LakeFeatureProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
|
||||
exp_manager:
|
||||
class: MLflowExpManager
|
||||
module_path: qlib.workflow.expm
|
||||
kwargs:
|
||||
uri: "sqlite:///{{ LAKE }}/mlruns.db"
|
||||
default_exp_name: "tac-rd-rank-ablate"
|
||||
|
||||
task:
|
||||
model:
|
||||
class: RankICLGBModel
|
||||
module_path: tac_qlib.contrib.model.rank_gbdt
|
||||
kwargs:
|
||||
loss: mse
|
||||
learning_rate: 0.02
|
||||
num_leaves: 31
|
||||
n_estimators: 3000
|
||||
num_boost_round: 3000
|
||||
early_stopping_rounds: 200
|
||||
min_data_in_leaf: 20
|
||||
lambda_l2: 0.5
|
||||
colsample_bytree: 0.8
|
||||
subsample: 0.8
|
||||
subsample_freq: 1
|
||||
reg_alpha: 0.1
|
||||
reg_lambda: 1.0
|
||||
seed: 42
|
||||
|
||||
dataset:
|
||||
class: DatasetH
|
||||
module_path: qlib.data.dataset
|
||||
kwargs:
|
||||
handler:
|
||||
class: TACHandler
|
||||
module_path: tac_qlib.contrib.data.handler
|
||||
kwargs:
|
||||
instruments: "{{ UNIVERSE }}"
|
||||
start_time: 2015-01-03
|
||||
end_time: 2026-08-10
|
||||
fit_start_time: 2015-01-03
|
||||
fit_end_time: 2025-09-01
|
||||
freq: day
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
label: "Ref($close,-6)/Ref($close,-1)-1"
|
||||
feature_fields: "$open,$high,$low,$close,$vwap,$volume,{{ SP_FIELDS }}"
|
||||
infer_processors:
|
||||
- class: DropAllNaN
|
||||
kwargs: {}
|
||||
- class: ProcessInf
|
||||
kwargs: {}
|
||||
- class: CSRankNorm
|
||||
kwargs: {}
|
||||
- class: ZScoreNorm
|
||||
kwargs: {}
|
||||
- class: Fillna
|
||||
kwargs: {}
|
||||
segments:
|
||||
train: [2015-01-03, 2025-09-01]
|
||||
valid: [2025-09-03, 2026-01-03]
|
||||
test: [2026-01-04, 2026-08-10]
|
||||
|
||||
record:
|
||||
- class: SignalRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs: {}
|
||||
- class: SigAnaRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs:
|
||||
ana_long_short: true
|
||||
ann_scaler: 252
|
||||
- class: PortAnaRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs:
|
||||
config:
|
||||
strategy:
|
||||
class: TopkDropoutStrategy
|
||||
module_path: qlib.contrib.strategy
|
||||
kwargs:
|
||||
signal: "<PRED>"
|
||||
topk: 10
|
||||
n_drop: 2
|
||||
only_tradable: true
|
||||
risk_degree: 0.95
|
||||
backtest:
|
||||
start_time: 2026-01-04
|
||||
end_time: 2026-08-10
|
||||
account: 1000000
|
||||
benchmark: SPY
|
||||
exchange_kwargs:
|
||||
codes: "{{ UNIVERSE }}"
|
||||
deal_price: $close
|
||||
freq: day
|
||||
open_cost: 0.0005
|
||||
close_cost: 0.0015
|
||||
min_cost: 5.0
|
||||
risk_analysis_freq: 1d
|
||||
@@ -1,141 +0,0 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# ISOLATION: multi-seed RankIC ensemble, ablate-B generic-only feature set.
|
||||
#
|
||||
# Isolates the ensemble effect on the SP-5d rank signal. Same panel, segments,
|
||||
# history (full backfilled 2016+) and feature set as the exp-9 ablate-B winner
|
||||
# (generic-only sp_* families: jump,har,trend,hurst,signature), but replaces the
|
||||
# single RankICLGBModel with a 5-seed RankICEnsembleLGBModel (42,7,2026,99,123)
|
||||
# that averages per-day predictions.
|
||||
#
|
||||
# Differs from exp-15 (tac-rd-rank-ensemble, mlflow exp 15) ONLY by dropping the
|
||||
# TA subset (rsi_14,roc_10,macd_hist,willr_14,atr_14) and the inter-asset xr_*
|
||||
# features, so any change vs exp-15 is attributable to the feature set alone,
|
||||
# and any change vs exp-9 is attributable to the ensemble + full history alone.
|
||||
#
|
||||
# Run:
|
||||
# rd_run_workflow config_path=experiments/workflows/exp12_isolation_ensemble.yaml \
|
||||
# experiment_name=tac-rd-rank-ensemble-isolated
|
||||
# -----------------------------------------------------------------------------
|
||||
{%- 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 SP_FIELDS = "sp_ret,sp_jump_ratio,sp_jump_flag,sp_jump_tail,sp_max_move,sp_rv1,sp_rv5,sp_rv22,sp_vol_ratio_5_22,sp_vol_ratio_1_22,sp_trend_slope_5,sp_trend_slope_20,sp_trend_slope_60,sp_logp,sp_hurst_exponent,sp_sig_level1_lead,sp_sig_level1_lag,sp_sig_level2_lead_lag,sp_sig_level2_lag_lead" %}
|
||||
|
||||
qlib_init:
|
||||
provider_uri: "{{ LAKE }}"
|
||||
region: us
|
||||
expression_cache: null
|
||||
dataset_cache: null
|
||||
|
||||
calendar_provider:
|
||||
class: tac_qlib.data.providers.LakeCalendarProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
instrument_provider:
|
||||
class: tac_qlib.data.providers.LakeInstrumentProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
markets: {}
|
||||
feature_provider:
|
||||
class: tac_qlib.data.providers.LakeFeatureProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
|
||||
exp_manager:
|
||||
class: MLflowExpManager
|
||||
module_path: qlib.workflow.expm
|
||||
kwargs:
|
||||
uri: "sqlite:///mlruns.db"
|
||||
default_exp_name: "tac-rd-rank-ensemble-isolated"
|
||||
|
||||
task:
|
||||
model:
|
||||
class: RankICEnsembleLGBModel
|
||||
module_path: tac_qlib.contrib.model.rank_ensemble
|
||||
kwargs:
|
||||
loss: mse
|
||||
learning_rate: 0.02
|
||||
num_leaves: 31
|
||||
n_estimators: 3000
|
||||
num_boost_round: 3000
|
||||
early_stopping_rounds: 200
|
||||
min_data_in_leaf: 20
|
||||
lambda_l2: 0.5
|
||||
colsample_bytree: 0.8
|
||||
subsample: 0.8
|
||||
subsample_freq: 1
|
||||
reg_alpha: 0.1
|
||||
reg_lambda: 1.0
|
||||
seeds: "42,7,2026,99,123"
|
||||
|
||||
dataset:
|
||||
class: DatasetH
|
||||
module_path: qlib.data.dataset
|
||||
kwargs:
|
||||
handler:
|
||||
class: TACHandler
|
||||
module_path: tac_qlib.contrib.data.handler
|
||||
kwargs:
|
||||
instruments: "{{ UNIVERSE }}"
|
||||
start_time: 2015-01-03
|
||||
end_time: 2026-08-14
|
||||
fit_start_time: 2016-01-04
|
||||
fit_end_time: 2025-09-01
|
||||
freq: day
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
label: "Ref($close,-6)/Ref($close,-1)-1"
|
||||
feature_fields: "$open,$high,$low,$close,$vwap,$volume,{{ SP_FIELDS }}"
|
||||
infer_processors:
|
||||
- class: DropAllNaN
|
||||
kwargs: {}
|
||||
- class: ProcessInf
|
||||
kwargs: {}
|
||||
- class: CSRankNorm
|
||||
kwargs: {}
|
||||
- class: ZScoreNorm
|
||||
kwargs: {}
|
||||
- class: Fillna
|
||||
kwargs: {}
|
||||
segments:
|
||||
train: [2016-01-04, 2025-09-01]
|
||||
valid: [2025-09-03, 2026-01-03]
|
||||
test: [2026-01-04, 2026-08-10]
|
||||
|
||||
record:
|
||||
- class: SignalRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs: {}
|
||||
- class: SigAnaRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs:
|
||||
ana_long_short: true
|
||||
ann_scaler: 252
|
||||
- class: PortAnaRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs:
|
||||
config:
|
||||
strategy:
|
||||
class: TopkDropoutStrategy
|
||||
module_path: qlib.contrib.strategy
|
||||
kwargs:
|
||||
signal: "<PRED>"
|
||||
topk: 10
|
||||
n_drop: 2
|
||||
only_tradable: true
|
||||
risk_degree: 0.95
|
||||
backtest:
|
||||
start_time: 2026-01-04
|
||||
end_time: 2026-08-10
|
||||
account: 1000000
|
||||
benchmark: SPY
|
||||
exchange_kwargs:
|
||||
codes: "{{ UNIVERSE }}"
|
||||
deal_price: $close
|
||||
freq: day
|
||||
open_cost: 0.0005
|
||||
close_cost: 0.0015
|
||||
min_cost: 5.0
|
||||
risk_analysis_freq: 1d
|
||||
@@ -1,141 +0,0 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# EXP 18 - Risk-limit control: reference model + TopkDropout baseline (A).
|
||||
#
|
||||
# Signal/model identical to the reference (tac-rd-rank-ensemble-isolated,
|
||||
# run 0cea66d9...): RankICEnsembleLGBModel (parallel, 5 seeds) on the 50-ETF
|
||||
# SP-5d panel, test 2026-01-04..2026-08-10. This workflow reproduces the
|
||||
# unconstrained TopkDropout baseline net-of-cost so the risk-limited variant
|
||||
# (same pred, liquidity/size/concentration caps) can be compared 1:1.
|
||||
#
|
||||
# The risk_limits spec itself is applied via rd_backtest / rd_strategy_targets
|
||||
# (tool-level param, not a YAML key); this run records the unconstrained
|
||||
# baseline that the limit A/B is measured against.
|
||||
#
|
||||
# Run:
|
||||
# rd_run_workflow config_path=experiments/workflows/exp18-risk-limit/a_baseline.yaml \
|
||||
# experiment_name=tac-rd-risk-limit
|
||||
# -----------------------------------------------------------------------------
|
||||
{%- 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 SP_FIELDS = "sp_ret,sp_jump_ratio,sp_jump_flag,sp_jump_tail,sp_max_move,sp_rv1,sp_rv5,sp_rv22,sp_vol_ratio_5_22,sp_vol_ratio_1_22,sp_trend_slope_5,sp_trend_slope_20,sp_trend_slope_60,sp_logp,sp_hurst_exponent,sp_sig_level1_lead,sp_sig_level1_lag,sp_sig_level2_lead_lag,sp_sig_level2_lag_lead" %}
|
||||
|
||||
qlib_init:
|
||||
provider_uri: "{{ LAKE }}"
|
||||
region: us
|
||||
expression_cache: null
|
||||
dataset_cache: null
|
||||
|
||||
calendar_provider:
|
||||
class: tac_qlib.data.providers.LakeCalendarProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
instrument_provider:
|
||||
class: tac_qlib.data.providers.LakeInstrumentProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
markets: {}
|
||||
feature_provider:
|
||||
class: tac_qlib.data.providers.LakeFeatureProvider
|
||||
kwargs:
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
|
||||
exp_manager:
|
||||
class: MLflowExpManager
|
||||
module_path: qlib.workflow.expm
|
||||
kwargs:
|
||||
uri: "sqlite:///{{ LAKE }}/mlruns.db"
|
||||
default_exp_name: "tac-rd-risk-limit"
|
||||
|
||||
task:
|
||||
model:
|
||||
class: RankICEnsembleLGBModel
|
||||
module_path: tac_qlib.contrib.model.rank_ensemble
|
||||
kwargs:
|
||||
loss: mse
|
||||
learning_rate: 0.02
|
||||
num_leaves: 31
|
||||
n_estimators: 3000
|
||||
num_boost_round: 3000
|
||||
early_stopping_rounds: 200
|
||||
min_data_in_leaf: 20
|
||||
lambda_l2: 0.5
|
||||
colsample_bytree: 0.8
|
||||
subsample: 0.8
|
||||
subsample_freq: 1
|
||||
reg_alpha: 0.1
|
||||
reg_lambda: 1.0
|
||||
seeds: "42,7,2026,99,123"
|
||||
parallel: 5
|
||||
|
||||
dataset:
|
||||
class: DatasetH
|
||||
module_path: qlib.data.dataset
|
||||
kwargs:
|
||||
handler:
|
||||
class: TACHandler
|
||||
module_path: tac_qlib.contrib.data.handler
|
||||
kwargs:
|
||||
instruments: "{{ UNIVERSE }}"
|
||||
start_time: 2015-01-03
|
||||
end_time: 2026-08-14
|
||||
fit_start_time: 2016-01-04
|
||||
fit_end_time: 2025-09-01
|
||||
freq: day
|
||||
lake_root: "{{ LAKE }}"
|
||||
market: US
|
||||
label: "Ref($close,-6)/Ref($close,-1)-1"
|
||||
feature_fields: "$open,$high,$low,$close,$vwap,$volume,{{ SP_FIELDS }}"
|
||||
infer_processors:
|
||||
- class: DropAllNaN
|
||||
kwargs: {}
|
||||
- class: ProcessInf
|
||||
kwargs: {}
|
||||
- class: CSRankNorm
|
||||
kwargs: {}
|
||||
- class: ZScoreNorm
|
||||
kwargs: {}
|
||||
- class: Fillna
|
||||
kwargs: {}
|
||||
segments:
|
||||
train: [2016-01-04, 2025-09-01]
|
||||
valid: [2025-09-03, 2026-01-03]
|
||||
test: [2026-01-04, 2026-08-10]
|
||||
|
||||
record:
|
||||
- class: SignalRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs: {}
|
||||
- class: SigAnaRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs:
|
||||
ana_long_short: true
|
||||
ann_scaler: 252
|
||||
- class: PortAnaRecord
|
||||
module_path: qlib.workflow.record_temp
|
||||
kwargs:
|
||||
config:
|
||||
strategy:
|
||||
class: TopkDropoutStrategy
|
||||
module_path: qlib.contrib.strategy
|
||||
kwargs:
|
||||
signal: "<PRED>"
|
||||
topk: 10
|
||||
n_drop: 2
|
||||
only_tradable: true
|
||||
risk_degree: 0.95
|
||||
backtest:
|
||||
start_time: 2026-01-04
|
||||
end_time: 2026-08-10
|
||||
account: 1000000
|
||||
benchmark: SPY
|
||||
exchange_kwargs:
|
||||
codes: "{{ UNIVERSE }}"
|
||||
deal_price: $close
|
||||
freq: day
|
||||
open_cost: 0.0005
|
||||
close_cost: 0.0015
|
||||
min_cost: 5.0
|
||||
risk_analysis_freq: 1d
|
||||
Reference in New Issue
Block a user