fix: filter NaN in max(), remove redundant ternary, handle non-finite vbt results

This commit is contained in:
TPTBusiness
2026-05-03 00:25:58 +02:00
parent bc15434e02
commit dcd4697b75
3 changed files with 8 additions and 5 deletions
@@ -83,7 +83,8 @@ def _cross_check_with_vbt(
init_cash=10_000.0,
freq=freq,
)
return float(pf.total_return())
tr = float(pf.total_return())
return tr if np.isfinite(tr) else None
except Exception:
return None