position-sizing
Skill16 starsChanged 8 months agoMITView on GitHub
Kelly criterion, optimal-f, fixed fractional, volatility targeting, risk parity position sizing, and practical implementation. Original Kelly (Binary Outcomes) - f* = (bp - q) / b, where b = odds, p = probability of win, q = 1-p - f* = fraction of capital to wager - Maximizes long-run geometric growth rate (log wealth) - Example: p = 0.55, b = 1 (even money) -> f* = (1*0.55 - 0.45)/1 = 0.10 (bet 10% of capital) Continuous Kelly (Normal Returns)…
7 other projects use a version of this.
Adopted by
Most recently taken up by
- Shubhamkumartrichy/claude-trading-skills-indiatheir own version, first seen Nov 1, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- IngAs8/ClaudeSkilltheir own version, first seen Sep 28, 2026
- Serennity007/claude-trading-skills-67their own version, first seen Aug 25, 2026
- SKE-Labs/agent-trading-skillstheir own version, first seen Jul 18, 2026
- agiprolabs/claude-trading-skillstheir own version, first seen Mar 11, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- agiprolabs/claude-trading-skills★ 366same name
- Shubhamkumartrichy/claude-trading-skills-india★ 56same name
- Bhala-Srinivash/nse-trading-skills★ 36same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- SKE-Labs/agent-trading-skills★ 17same name
- IngAs8/ClaudeSkill★ 0same name
- Serennity007/claude-trading-skills-67★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository83 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- live-trading-monitoringSkill
- monte-carlo-simulationSkill
- overfitting-preventionSkill
- research-notebooksSkill
- strategy-evaluationSkill
- walk-forward-optimizationSkill
- cross-chain-arbitrageSkill
- crypto-derivativesSkill
- defi-protocolsSkill
- mev-strategiesSkill
- on-chain-analyticsSkill
- stablecoin-analysisSkill
- tokenomicsSkill
- yield-farmingSkill
- alternative-dataSkill
- data-qualitySkill
- data-vendorsSkill
- feature-engineeringSkill
- sentiment-analysisSkill
- web-scraping-financeSkill
- binomial-treesSkill
- black-scholesSkill
- credit-derivativesSkill
- exotic-optionsSkill
- hedging-strategiesSkill
- interest-rate-derivativesSkill
- monte-carlo-pricingSkill
- structured-productsSkill
- vol-surfacesSkill
- vol-tradingSkill
- execution-algosSkill
- latency-optimizationSkill
- market-microstructure-theorySkill
- order-flow-analysisSkill
- performance-metricsSkill
- smart-order-routingSkill
- tick-data-processingSkill
- transaction-cost-analysisSkill
- central-bank-analysisSkill
- commodities-fundamentalsSkill
- economic-indicatorsSkill
- fx-fundamentalsSkill
- geopolitical-riskSkill
- yield-curve-analysisSkill
- alternative-allocationsSkill
- benchmark-trackingSkill
- black-littermanSkill
- factor-investingSkill
- markowitz-optimizationSkill
- portfolio-attributionSkill
- rebalancing-strategiesSkill
- risk-paritySkill
- alpha-researchSkill
- bayesian-methodsSkill
- deep-learning-tradingSkill
- factor-modelsSkill
- kalman-filtersSkill
- ml-for-financeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 45
Use f = c * f_Kelly where c is typically 0.20 to 0.50 (quarter to half Kelly)
- Distinctive: line 113
Instead of point estimates of mu and sigma, use posterior distributions
- Distinctive: line 188
Never use full Kelly in practice — maximum recommended is half Kelly for well-estimated strategies
- Distinctive: line 196
Document the sizing methodology and parameters.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Position Sizing Methodologies
Kelly criterion, optimal-f, fixed fractional, volatility targeting, risk parity position sizing, and practical implementation.
When to Activate
- User designing position sizing rules for a trading strategy
- Applying Kelly criterion or fractional Kelly to determine bet size
- Volatility-based position sizing for systematic strategies
- Risk budgeting and risk parity allocation across strategies or assets
- Evaluating the tradeoff between position size, expected return, and drawdown risk
- Comparing position sizing methods for a given strategy profile
Core Concepts
Kelly Criterion
Original Kelly (Binary Outcomes)
- f* = (bp - q) / b, where b = odds, p = probability of win, q = 1-p
- f* = fraction of capital to wager
- Maximizes long-run geometric growth rate (log wealth)
- Example: p = 0.55, b = 1 (even money) -> f* = (1*0.55 - 0.45)/1 = 0.10 (bet 10% of capital)
Continuous Kelly (Normal Returns)
- f* = (mu - r_f) / sigma^2, where mu = expected return, sigma = volatility
- For a strategy with 15% expected excess return and 20% vol: f* = 0.15/0.04 = 3.75x leverage
- This is the leverage that maximizes geometric growth
- Equivalent to maximizing E[ln(1 + f*r)] over the return distribution
Multi-Asset Kelly
- f* = Sigma^{-1} * mu (vector of optimal fractions = inverse covariance times expected excess returns)
- Equivalent to mean-variance optimization with risk aversion = 1 (maximizing log utility)
- Requires estimation of expected returns and covariance matrix — both noisy
Practical Problems with Full Kelly
- Full Kelly produces extreme drawdowns: probability of 50% drawdown is approximately 50%
- Parameter estimation error: overestimated mu or underestimated sigma leads to overleveraging
- Non-normal returns: fat tails make full Kelly even more dangerous
- Strategy capacity: full Kelly may imply positions that exceed market liquidity
- Result: essentially no professional trader uses full Kelly
Fractional Kelly
- Use f = c * f_Kelly where c is typically 0.20 to 0.50 (quarter to half Kelly)
- Half Kelly (c = 0.5): 75% of the growth rate but dramatically lower drawdowns
- Quarter Kelly (c = 0.25): 44% of the growth rate but very stable equity curve
- Fractional Kelly is equivalent to full Kelly with a blended estimate (mixing with zero-return prior)
- Fractional Kelly is more robust to parameter estimation error
Optimal-f (Ralph Vince)
- Generalization of Kelly for non-binary outcomes
- f* = the fraction that maximizes terminal wealth factor (TWR) over historical trades
- TWR = product of (1 + f * return_i / |worst_loss|) over all trades
- Find f* numerically by testing f from 0 to 1 in small increments
- Related to Kelly but does not assume a distribution — uses empirical trade history
- Danger: optimal-f is computed on in-sample data and may overfit
- Like full Kelly, produces severe drawdowns; use fractional optimal-f in practice
Methodology
Fixed Fractional Position Sizing
- Risk a fixed percentage of capital per trade (e.g., 1-2%)
- Position size = (risk_per_trade * capital) / (entry - stop_loss)
- Example: $1M capital, 1% risk, entry $50, stop $48
- Risk amount = $10,000
- Position size = $10,000 / $2 = 5,000 shares
- Automatically sizes down after losses and up after gains (anti-martingale)
- Prevents ruin: no single trade can lose more than the fixed fraction
- Simple and widely used in systematic and discretionary trading
Volatility-Based Position Sizing
Volatility Targeting
- Set target portfolio volatility (e.g., 10% annualized)
- For each position: weight_i = target_vol / (N * sigma_i) where sigma_i is asset volatility
- More volatile assets get smaller positions; less volatile get larger
- Rebalance when realized vol deviates significantly from target
- Equalizes risk contribution from each position (if uncorrelated)
ATR-Based Sizing (Turtle Traders)
- Compute N = 20-day ATR (Average True Range) for each instrument
- Dollar volatility = N * point_value
- Unit size = (1% of equity) / dollar_volatility
- Each "unit" represents approximately 1% equity risk per day
- Maximum units per market: 4 (maximum 4% of equity at risk per position)
- Maximum units per correlated group: 6-8
Risk Parity Position Sizing
- Target equal risk contribution from each asset/strategy
- In the simple (uncorrelated) case: w_i proportional to 1/sigma_i
- With correlations: solve for w such that w_i * (Sigma * w)_i = RC_target for all i
- Risk contribution of asset i: RC_i = w_i * (Sigma * w)_i / (w' * Sigma * w)
- Equal risk contribution: RC_i = 1/N for all i
- Requires leverage for low-vol assets (bonds) to equalize with high-vol assets (equities)
- Bridgewater All Weather is the canonical risk parity portfolio
Risk Budgeting
- Assign risk budgets to each strategy or asset class (need not be equal)
- Risk budget = percentage of total portfolio risk attributed to each component
- Example: equities 40%, fixed income 30%, alternatives 30% of total risk
- Solve for weights that achieve the target risk allocation
- Component risk = w_i * marginal_risk_i = w_i * (Sigma * w)_i / sigma_portfolio
- Iterate or use optimization to find weights matching target risk budgets
Kelly with Parameter Uncertainty
Bayesian Kelly
- Instead of point estimates of mu and sigma, use posterior distributions
- Optimal bet size accounts for parameter uncertainty
- Results in smaller positions than plug-in Kelly — natural shrinkage
- With diffuse priors, Bayesian Kelly approximately equals 0.5 * plug-in Kelly
Shrinkage Approaches
- Shrink expected return estimates toward zero (or grand mean)
- Shrink covariance toward structured estimator (Ledoit-Wolf)
- Effective position size decreases as uncertainty increases
- More robust to estimation error than naive Kelly
Examples
Kelly Criterion for a Trading Strategy
Strategy backtest: annual excess return = 12%, annual volatility = 18%
Full Kelly: f* = 0.12 / 0.18^2 = 3.7x leverage
Expected growth rate at full Kelly: mu - 0.5*sigma^2*f = 12% - 0.5*3.24%*3.7 = 6%
Expected max drawdown at full Kelly: approximately 50%+
Half Kelly: f = 1.85x leverage
Expected growth rate: approximately 4.5%
Expected max drawdown: approximately 25%
Quarter Kelly: f = 0.93x leverage (no leverage needed)
Expected growth rate: approximately 3%
Expected max drawdown: approximately 12%
Recommendation: half Kelly (1.85x) if drawdown tolerance is 25%;
quarter Kelly (0.93x) if more conservative.ATR-Based Position Sizing
Account equity: $500,000
Risk per unit: 1% = $5,000
Crude oil (CL): ATR(20) = $2.50, point value = $1,000/point
Dollar vol = $2.50 * $1,000 = $2,500
Unit size = $5,000 / $2,500 = 2 contracts
E-mini S&P (ES): ATR(20) = 45 points, point value = $50/point
Dollar vol = 45 * $50 = $2,250
Unit size = $5,000 / $2,250 = 2 contracts (round down)
Gold (GC): ATR(20) = $25, point value = $100/point
Dollar vol = $25 * $100 = $2,500
Unit size = $5,000 / $2,500 = 2 contracts
Each position risks approximately $5,000 (1% of equity) per ATR move.
Maximum 4 units per market = 4% equity risk per market.Risk Parity Allocation
Three-asset portfolio: Equities (vol=16%), Bonds (vol=5%), Commodities (vol=20%)
Assuming zero correlations (simplification):
Equal risk contribution target: 33.3% each
w_equity proportional to 1/16 = 0.0625
w_bonds proportional to 1/5 = 0.2000
w_commod proportional to 1/20 = 0.0500
Normalized: w_equity = 20%, w_bonds = 63%, w_commod = 16%
Sum = 99% (approximately 1x leverage)
To target 10% portfolio vol:
Unlevered portfolio vol = sqrt(0.20^2*16^2 + 0.63^2*5^2 + 0.16^2*20^2) = 5.4%
Leverage = 10% / 5.4% = 1.85x
Levered weights: equities 37%, bonds 117%, commodities 30%Quality Gate
- Kelly fraction must be computed with realistic (after-cost, after-slippage) return estimates
- Never use full Kelly in practice — maximum recommended is half Kelly for well-estimated strategies
- Parameter uncertainty must be accounted for: use Bayesian Kelly or fractional Kelly
- Position sizes must respect market liquidity constraints (max % of ADV)
- Volatility estimates for sizing must use appropriate lookback (20-60 day realized vol or EWMA)
- Risk parity weights must be rebalanced when volatility or correlation estimates change materially
- Total portfolio leverage must be within acceptable bounds regardless of what Kelly implies
- Sizing rules must be backtested with transaction costs and slippage included
- Maximum position size limits must exist as a hard constraint independent of the sizing formula
- Document the sizing methodology and parameters; review quarterly
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

