def half_kelly_fraction(win_prob: float, payoff_ratio: float, atr_slippage_bps: float = 4.5) -> float:
eff_b = max(0.1, payoff_ratio - (atr_slippage_bps / 100.0))
full_k = (win_prob * eff_b - (1.0 - win_prob)) / eff_b
return round(max(0.0, min(0.25, full_k * 0.5)), 4)
Enter your work or engineering email to unblur the copy-paste remediation script in-place, email a copy of your custom report, and unlock a 35% First-Order Credit ($12.35):
✓ Full diagnostic script unlocked below & report queued to your inbox. Your 35% First-Order Credit (FIRST_ORDER_35) is now active on the checkout button!