position-sizing
Skill33 starsChanged 36 days agoMITView on GitHub
Use when deciding how large a position to take. Covers fixed-fractional risk, volatility-based sizing, the Kelly criterion and why to fractionalize it, and portfolio concentration limits. Trigger on "how much should i put in this trade", "how many shares should i buy", "should i use kelly sizing". Do not use for account-level drawdown limits and pre-trade rules — see the risk-management skill.
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
- 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
- brainbytes-dev/everything-claude-tradingtheir own version, first seen Mar 14, 2026
- agiprolabs/claude-trading-skillstheir own version, first seen Mar 11, 2026
Used with
Projects with it also use mean-reversion, feature-engineering and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
agiprolabsSkillmean-reversion
Mean-reversion strategy tools including Hurst exponent, half-life estimation, z-score signals, ADF testing, and Ornstein-Uhlenbeck modeling
Also in 4 projects that use this
ffsshhttiikkSkillfeature-engineering
Machine learning feature engineering
Also in 3 projects that use this
MicrosoftSkillsentiment-analysis
Use when a director of product asks for the fictional sentiment split and recent excerpts.
Also in 3 projects that use this
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
- SKE-Labs/agent-trading-skills★ 17same name
- brainbytes-dev/everything-claude-trading★ 16same 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 repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
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 54
Never widen a stop to justify a larger position.
“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
Purpose
Determine how much to risk on a single position, so that a losing streak is survivable and no single idea can end the account. Position sizing determines survival; entry selection determines returns. Survival comes first.
When to Use
- Deciding how many shares or contracts to buy.
- Setting a risk-per-trade policy.
- Checking whether a position breaches concentration limits.
- Reviewing why a drawdown was deeper than expected.
Capabilities
- Fixed-fractional sizing from a stop distance.
- Volatility-adjusted sizing using ATR.
- Kelly criterion, and fractional Kelly in practice.
- Concentration limits: per position, per sector, per correlated group.
- Aggregate portfolio risk.
Inputs
- Account equity.
- Entry price and stop price (or an ATR and a multiplier).
- Risk per trade, as a percentage of equity.
- Existing exposure, including correlated positions.
Outputs
- A share or contract count.
- The dollar risk if the stop is hit, stated explicitly.
- Whether the position breaches any limit.
Workflow
- Fix the risk per trade first — Typically 0.5% to 2% of equity. This is a policy decision made when calm, not a per-trade judgment made when excited.
- Determine the stop — At a level where the thesis is wrong, not at a level that produces a comfortable size. This is the discipline that everything else depends on.
- Size from the stop distance — Shares = (equity × risk%) / (entry − stop). A wider stop means a smaller position, not more risk.
- Check the concentration limits — Position size as a percentage of equity, sector exposure, and correlated exposure. A limit breached is a size reduced.
- Check the aggregate — Ten positions each risking 1% is 10% at risk if they are correlated and all stop out together. In a market-wide selloff, they will be.
Best Practices
- Never widen a stop to justify a larger position. That inverts the entire logic: the stop defines the risk, and the size follows from it.
- Correlated positions are one position. Five semiconductor names is one bet on semiconductors, and it should be sized as one.
- Full Kelly is theoretically optimal and practically unusable: it produces enormous drawdowns, and it assumes you know your edge precisely. You do not. Half-Kelly or less is the practical range.
- A 50% drawdown requires a 100% gain to recover. Sizing that permits deep drawdowns is not aggressive; it is arithmetically self-defeating.
- Volatility-based sizing normalizes risk across instruments: a fixed dollar risk on a volatile stock and a quiet one produces very different position values, and that is correct.
- Recalculate the size on the current equity, not on the starting equity. Sizing off a high-water mark after a drawdown compounds the damage.
Examples
Fixed-fractional sizing — the calculation that matters:
def position_size(
equity: float,
entry: float,
stop: float,
risk_pct: float = 0.01,
max_position_pct: float = 0.20,
) -> PositionSize:
if stop >= entry:
raise ValueError("stop must be below entry for a long position")
risk_dollars = equity * risk_pct
risk_per_share = entry - stop
shares = int(risk_dollars / risk_per_share)
# The concentration limit binds independently of the risk limit. A very tight
# stop can otherwise produce a position worth more than the account.
max_shares_by_concentration = int((equity * max_position_pct) / entry)
limited = shares > max_shares_by_concentration
final = min(shares, max_shares_by_concentration)
return PositionSize(
shares=final,
position_value=final * entry,
dollar_risk=final * risk_per_share,
pct_of_equity=(final * entry) / equity,
limited_by_concentration=limited,
)
# equity 100,000 | entry 50.00 | stop 47.50 | risk 1%
# risk_dollars = 1,000
# risk_per_share = 2.50
# shares = 400 -> position value 20,000 (20% of equity)
# At the concentration cap exactly. A tighter stop of 49.50 would compute
# 2,000 shares ($100,000 — the whole account), and the cap correctly binds.Kelly, and why it is fractionalized:
def kelly_fraction(win_rate: float, avg_win: float, avg_loss: float) -> float:
"""f* = p - q/b, where b is the win/loss ratio."""
b = avg_win / abs(avg_loss)
f = win_rate - (1 - win_rate) / b
return max(0.0, f)
# A genuinely good strategy: 55% win rate, 1.5:1 payoff.
# full Kelly = 0.55 - 0.45/1.5 = 0.25 -> risk 25% of equity per trade
#
# Full Kelly on this strategy produces expected drawdowns exceeding 50% and
# assumes the 55% and the 1.5 are known exactly. They are estimates from a
# finite sample; if the true win rate is 50%, full Kelly is a losing bet.
#
# half Kelly = 12.5% still aggressive
# quarter Kelly = 6.25% the upper end of what most practitioners use
#
# Most professional risk budgets land between 0.5% and 2% — far below even
# quarter Kelly — because the edge estimate is uncertain and ruin is permanent.Notes
- Kelly maximizes the expected logarithmic growth rate given a known edge. The edge is never known; it is estimated from a sample, and the estimate is biased upward by the fact that you chose this strategy because it looked good. Fractionalize accordingly.
- Correlation rises toward 1 in a crisis. A portfolio that appears diversified in normal conditions can be a single position at the worst moment. Size for the correlated case.
- This is educational material about position-sizing methodology, not financial advice. Any real allocation decision depends on circumstances this skill cannot see.
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.

