|
|
@@ -371,8 +371,8 @@ signal.fillna(0).to_pickle('signal.pkl')
|
|
|
|
txn_cost_bps=TXN_COST_BPS,
|
|
|
|
txn_cost_bps=TXN_COST_BPS,
|
|
|
|
forward_returns=fwd_returns,
|
|
|
|
forward_returns=fwd_returns,
|
|
|
|
oos_start=OOS_START_DEFAULT,
|
|
|
|
oos_start=OOS_START_DEFAULT,
|
|
|
|
wf_rolling=True,
|
|
|
|
wf_rolling=False, # too slow on 2M bars — run via rebacktest script instead
|
|
|
|
mc_n_permutations=200,
|
|
|
|
mc_n_permutations=50,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
# ============================================================================
|
|
|
@@ -579,7 +579,7 @@ def main(target_count=10):
|
|
|
|
# Check acceptance criteria — OOS must be profitable + statistically significant
|
|
|
|
# Check acceptance criteria — OOS must be profitable + statistically significant
|
|
|
|
mc_ok = mc_pvalue is None or mc_pvalue < 0.20 # lenient: top 20% non-random
|
|
|
|
mc_ok = mc_pvalue is None or mc_pvalue < 0.20 # lenient: top 20% non-random
|
|
|
|
wf_ok = wf_consistency is None or wf_consistency >= 0.5 # ≥50% of WF windows profitable
|
|
|
|
wf_ok = wf_consistency is None or wf_consistency >= 0.5 # ≥50% of WF windows profitable
|
|
|
|
if (abs(ic) > MIN_IC and sharpe > MIN_SHARPE and trades > MIN_TRADES and dd > MAX_DRAWDOWN
|
|
|
|
if (abs(ic or 0) > MIN_IC and sharpe > MIN_SHARPE and trades > MIN_TRADES and dd > MAX_DRAWDOWN
|
|
|
|
and oos_sharpe > 0.0 and oos_monthly > 0.0 and mc_ok and wf_ok):
|
|
|
|
and oos_sharpe > 0.0 and oos_monthly > 0.0 and mc_ok and wf_ok):
|
|
|
|
# ACCEPT
|
|
|
|
# ACCEPT
|
|
|
|
strategy['real_backtest'] = bt_result
|
|
|
|
strategy['real_backtest'] = bt_result
|
|
|
@@ -636,9 +636,10 @@ def main(target_count=10):
|
|
|
|
oos_info = f"OOS_Sharpe={oos_sharpe:+.2f} OOS_Mon={oos_monthly:+.2f}%" if oos_sharpe is not None else ""
|
|
|
|
oos_info = f"OOS_Sharpe={oos_sharpe:+.2f} OOS_Mon={oos_monthly:+.2f}%" if oos_sharpe is not None else ""
|
|
|
|
mc_info = f" MC_p={mc_pvalue:.2f}" if mc_pvalue is not None else ""
|
|
|
|
mc_info = f" MC_p={mc_pvalue:.2f}" if mc_pvalue is not None else ""
|
|
|
|
wf_info = f" WF_consistency={wf_consistency:.0%}" if wf_consistency is not None else ""
|
|
|
|
wf_info = f" WF_consistency={wf_consistency:.0%}" if wf_consistency is not None else ""
|
|
|
|
_log.info(f"REJECTED IC={ic:.4f} Sharpe={sharpe:.2f} Trades={trades} DD={dd:.1%} {oos_info}{mc_info}{wf_info}")
|
|
|
|
_ic = ic or 0; _sh = sharpe or 0; _dd = dd or 0
|
|
|
|
|
|
|
|
_log.info(f"REJECTED IC={_ic:.4f} Sharpe={_sh:.2f} Trades={trades} DD={_dd:.1%} {oos_info}{mc_info}{wf_info}")
|
|
|
|
feedback_history.append(
|
|
|
|
feedback_history.append(
|
|
|
|
f"Failed: IC={ic:.4f}, Sharpe={sharpe:.2f}, Trades={trades}, DD={dd:.1%}, "
|
|
|
|
f"Failed: IC={_ic:.4f}, Sharpe={_sh:.2f}, Trades={trades}, DD={_dd:.1%}, "
|
|
|
|
f"OOS_Sharpe={oos_sharpe:+.2f}, OOS_Monthly={oos_monthly:+.2f}%"
|
|
|
|
f"OOS_Sharpe={oos_sharpe:+.2f}, OOS_Monthly={oos_monthly:+.2f}%"
|
|
|
|
+ (f", MC_p={mc_pvalue:.2f}" if mc_pvalue is not None else "")
|
|
|
|
+ (f", MC_p={mc_pvalue:.2f}" if mc_pvalue is not None else "")
|
|
|
|
+ (f", WF_consistency={wf_consistency:.0%}" if wf_consistency is not None else "")
|
|
|
|
+ (f", WF_consistency={wf_consistency:.0%}" if wf_consistency is not None else "")
|
|
|
|