Skip to content

Commit d75cba9

Browse files
TPTBusinessclaude
andcommitted
fix(strategies): guard against None IC in acceptance check, disable slow wf_rolling
- abs(ic or 0) prevents TypeError crash when backtest returns no IC value - wf_rolling=False and mc_n_permutations=50 for faster generation runs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 38fa760 commit d75cba9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/predix_gen_strategies_real_bt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ def run_backtest(close, factors_df, strategy_code):
371371
txn_cost_bps=TXN_COST_BPS,
372372
forward_returns=fwd_returns,
373373
oos_start=OOS_START_DEFAULT,
374-
wf_rolling=True,
375-
mc_n_permutations=200,
374+
wf_rolling=False, # too slow on 2M bars — run via rebacktest script instead
375+
mc_n_permutations=50,
376376
)
377377

378378
# ============================================================================
@@ -579,7 +579,7 @@ def main(target_count=10):
579579
# Check acceptance criteria — OOS must be profitable + statistically significant
580580
mc_ok = mc_pvalue is None or mc_pvalue < 0.20 # lenient: top 20% non-random
581581
wf_ok = wf_consistency is None or wf_consistency >= 0.5 # ≥50% of WF windows profitable
582-
if (abs(ic) > MIN_IC and sharpe > MIN_SHARPE and trades > MIN_TRADES and dd > MAX_DRAWDOWN
582+
if (abs(ic or 0) > MIN_IC and sharpe > MIN_SHARPE and trades > MIN_TRADES and dd > MAX_DRAWDOWN
583583
and oos_sharpe > 0.0 and oos_monthly > 0.0 and mc_ok and wf_ok):
584584
# ACCEPT
585585
strategy['real_backtest'] = bt_result

0 commit comments

Comments
 (0)