← ClaudeAtlas

bet-sizinglisted

Turn a predicted probability into a position - the 2*Phi(z)-1 size curve, averaging concurrent bets instead of adding them, discretising to buy turnover, and the concurrency budget whose divisor is usually a look-ahead. TRIGGER - bet sizing, getSignal, get_signal, getBetSize, bet size from probability, avgActiveSignals, average active bets, discreteSignal, discrete signal, step size, position from predict_proba, "how big should this trade be", "my positions flip every bar", turnover from a probability, concurrent bets leverage, budgeting bets, Lopez de Prado chapter 10, AFML bet sizing. SKIP for the Kelly fraction and how large the book should be overall (position-sizing-kelly - it owns Kelly, do not repeat it), for the secondary model that produces the probability (meta-labeling), for volatility targeting and risk budgets (portfolio-and-risk), and for the execution schedule once the size is chosen (execution-algorithms).
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# Bet sizing **A probability is not a position, and the four steps between them each cost something measurable.** Advances in Financial Machine Learning (Lopez de Prado 2018), chapter 10. The size curve, the averaging of concurrent bets, the discretisation, and the leverage budget — all four are usually written in one line each, and three of them are usually wrong. Every number below is printed by `scripts/bet_sizing.py` (numpy + scipy, seed 0, **2.8 s**). ⚠️ **This chapter is the one place in this plugin with no runnable reference implementation.** mlfinpy 0.1.2 ships no bet-sizing module (its packages are `labeling`, `sample_weights`, `sampling`, `filters`, `structural_breaks`, `cross_validation`, `ensemble`, `data_structure`, `util`, `dataset`), and 🔴 `mlfinlab` is not installable — ✅ checked 2026-09-09: the PyPI JSON API returns 404 and the simple index lists zero distribution files. The formulas below are transcribed from the published snippets; what is **measured** is every property they should have. ## 1. The size curve is not `2p - 1` ``` z = (p - 1/n_classes) / sqrt(p (1 - p)) m = 2 * Phi(z) - 1 signal = side * m ``` ⚠️ AFML Snippet 10.1 (page 142), `getSignal` / `getBetSize`. ✅ Measured against the obvious alternative: | p | z | **m = 2Φ(z)-1** | 2p - 1 | m / (2p-1) | |---|---|---|---|---| | 0.50 | 0.000 | **0.0000** | 0.00 | — | | 0.55 | 0.101 | 0.0801 | 0.10 | **0.801** | | 0.60 | 0.204 | 0.1617 | 0.20 | 0.809 | | 0.70 | 0.436 | 0.3375 | 0.40