- Home
- Skills
- Finance & Accounting
- position-sizing-kelly
Works with the AI Agents you already use
Position Sizing Kelly
by BanditXBT
Size positions with fractional Kelly, vol targeting, drawdown limits and liquidation-aware crypto leverage.
$29
About this skill
Sizing converts an edge estimate into capital at risk. The edge is always an estimate; size for its uncertainty, not its point value. Educational analysis, not investment advice; state assumptions and data sources.
-
Discrete bet (win prob p, q=1-p, net payoff b per unit risked):
f* = (b*p - q)/b = p - q/b. -
Continuous/small-edge approximation:
f* = mu/sigma^2(mu = expected excess return per period, sigma^2 = variance); multi-assetf* = Sigma^-1 mu. Fat tails and skew break it: for a return sample, numerically maximizemean(log(1 + f*r))instead, then shrink. -
Under GBM, growth
g(f) = f*mu - f^2*sigma^2/2, maximized at f*. Atf = 2f*growth equals the risk-free rate (zero excess growth); beyond that it is lower still. -
Fraction c of Kelly (f = c f*) gives
(2c - c^2)of maximum growth with c^2 of the variance (c of the volatility): half Kelly keeps about 75% of growth with 25% of the variance (50% of the vol). -
Drawdown (continuous-time GBM, infinite horizon; derived from the hitting probability of drifted Brownian motion for log wealth): P(wealth ever falls to fraction x < 1 of start) =
x^(2/c - 1). Full Kelly: 50% chance of ever halving. Half Kelly:x^3, so 12.5% for halving. Discrete bets, fat tails, finite horizons differ: bootstrap. -
Overbetting is penalized more than underbetting: growth is quadratic in f and turns negative above 2f*. Shrink.
-
se(mu) ~ sigma/sqrt(T). Annualized Sharpe 1 over 3 years has SE about sqrt((1+SR^2/2)/3) = 0.71 (Lo 2002 iid approximation), and Kelly size is proportional to the edge, so a 1-SE band (Sharpe 0.3 to 1.7) moves size by several-fold. Size on a lower confidence bound (e.g., mu - 1 se) or shrink toward zero edge with a Bayesian prior. -
Heuristic default: 0.25-0.5 Kelly for model-derived edges; the upper end only for long, out-of-sample, cost-net evidence. Validate mu with strategy-statistical-validation and backtest-integrity-audit; see signal-research-alpha-decay for edge half-life.
-
Use net-of-cost mu (fees, slippage, funding; see execution-cost-tca). Impact scales with size, so cap size where marginal impact equals marginal edge.
-
Position =
target_vol / forecast_vol * capital, leverage capped. Forecast with EWMA (RiskMetrics lambda 0.94 daily) or GARCH blended with long-run vol; evaluate out of sample (see regime-detection-volatility). -
Empirically, volatility scaling has helped Sharpe mainly in assets with a leverage effect (equities, credit) and little elsewhere (Harvey et al., J. Portfolio Mgmt 2018). It lags gap moves: size for jump risk separately (see drawdown-tail-risk-var).
-
Use buffer bands (e.g., rebalance only if target moves >20%, heuristic) to limit cost drag.
Educational analysis, not investment advice. The drawdown formula is a continuous-time approximation; liquidation formulas vary by venue.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 13 days ago
- Software
Python 3numpy
Permissions
No special permissions declared or detected
What's inside
Frequently Asked Questions
New in Finance & Accounting
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Finance & Accounting.