/position-sizer
Calculate risk-based position sizes for long stock trades. Use when user asks about position sizing, how many shares to buy, risk per trade, Kelly criterion, ATR-based sizing, or portfolio risk allocation. Supports stop-loss distance calculation, volatility scaling, and sector
$ npx -y skills add Wind-Alice/AliceMarket --skill position-sizer --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/position-sizer
Context preview
The summary Claude sees to decide when to auto-load this skill.
Calculate risk-based position sizes for long stock trades. Use when user asks about position sizing, how many shares to buy, risk per trade, Kelly criterion, ATR-based sizing, or portfolio risk allocation. Supports stop-loss distance calculation, volatility scaling, and sector
SKILL.md
position-sizer.SKILL.mdname: position-sizer
description: Calculate risk-based position sizes for long stock trades. Use when user asks about position sizing, how many shares to buy, risk per trade, Kelly criterion, ATR-based sizing, or portfolio risk allocation. Supports stop-loss distance calculation, volatility scaling, and sector concentration checks.
Position Sizer
Overview
Calculate the optimal number of shares to buy for a long stock trade based on risk management principles. Supports three sizing methods:
- **Fixed Fractional**: Risk a fixed percentage of account equity per trade (default: 1%)
- **ATR-Based**: Use Average True Range to set volatility-adjusted stop distances
- **Kelly Criterion**: Calculate mathematically optimal risk allocation from historical win/loss statistics
All methods apply portfolio constraints (max position %, max sector %) and output a final recommended share count with full risk breakdown.
When to Use
- User asks "how many shares should I buy?"
- User wants to calculate position size for a specific trade setup
- User mentions risk per trade, stop-loss sizing, or portfolio allocation
- User asks about Kelly Criterion or ATR-based position sizing
- User wants to check if a position fits within portfolio concentration limits
Prerequisites
- No API keys required
- Python 3.9+ with standard library only
Workflow
Step 1: Gather Trade Parameters
Collect from the user:
- **Required**: Account size (total equity)
- **Mode A (Fixed Fractional)**: Entry price, stop price, risk percentage (default 1%)
- **Mode B (ATR-Based)**: Entry price, ATR value, ATR multiplier (default 2.0x), risk percentage
- **Mode C (Kelly Criterion)**: Win rate, average win, average loss; optionally entry and stop for share calculation
- **Optional constraints**: Max position % of account, max sector %, current sector exposure
If the user provides a stock ticker but not specific prices, use available tools to look up the current price and suggest entry/stop levels based on technical analysis.
Step 2: Execute Position Sizer Script
Run the position sizing calculation:
# Fixed Fractional (most common)
python3 skills/position-sizer/scripts/position_sizer.py \
--account-size 100000 \
--entry 155 \
--stop 148.50 \
--risk-pct 1.0 \
--output-dir reports/
# ATR-Based
python3 skills/position-sizer/scripts/position_sizer.py \
--account-size 100000 \
--entry 155 \
--atr 3.20 \
--atr-multiplier 2.0 \
--risk-pct 1.0 \
--output-dir reports/
# Kelly Criterion (budget mode - no entry)
python3 skills/position-sizer/scripts/position_sizer.py \
--account-size 100000 \
--win-rate 0.55 \
--avg-win 2.5 \
--avg-loss 1.0 \
--output-dir reports/
# Kelly Criterion (shares mode - with entry/stop)
python3 skills/position-sizer/scripts/position_sizer.py \
--account-size 100000 \
--entry 155 \
--stop 148.50 \
--win-rate 0.55 \
--avg-win 2.5 \
--avg-loss 1.0 \
--output-dir reports/
Step 3: Load Methodology Reference
Read `references/sizing_methodologies.md` to provide context on the chosen method, risk guidelines, and portfolio constraint best practices.
Step 4: Calculate Multiple Scenarios
If the user has not specified a single method, run multiple scenarios for comparison:
- Fixed Fractional at 0.5%, 1.0%, and 1.5% risk
- ATR-based at 1.5x, 2.0x, and 3.0x multipliers
- Present a comparison table showing shares, position value, and dollar risk for each
Step 5: Apply Portfolio Constraints and Determine Final Size
Add constraints if the user has portfolio context:
python3 skills/position-sizer/scripts/position_sizer.py \
--account-size 100000 \
--entry 155 \
--stop 148.50 \
--risk-pct 1.0 \
--max-position-pct 10 \
--max-sector-pct 30 \
--current-sector-exposure 22 \
--output-dir reports/
Explain which constraint is binding and why it limits the position.
Step 6: Generate Position Report
Present the final recommendation including:
- Method used and rationale
- Exact share count and position value
- Dollar risk and percentage of account
- Stop-loss price
- Any binding constraints
- Risk management reminders (portfolio heat, loss-cutting discipline)
Output Format
JSON Report
{
"schema_version": "1.0",
"mode": "shares",
"parameters": {
"entry_price": 155.0,
"account_size": 100000,
"stop_price": 148.50,
"risk_pct": 1.0
},
"calculations": {
"fixed_fractional": {
"method": "fixed_fractional",
"shares": 153,
"risk_per_share": 6.50,
"dollar_risk": 1000.0,
"stop_price": 148.50
},
"atr_based": null,
"kelly": null
},
"constraints_applied": [],
"final_recommended_shares": 153,
"final_position_value": 23715.0,
"final_risk_dollars": 994.50,
"final_risk_pct": 0.99,
"binding_constraint": null
}Markdown Report
Generated automatically alongside the JSON report. Contains:
- Parameters summary
- Calculation details for the active method
- Constraints analysis (if any)
- Final recommendation with shares, value, and risk
Reports are saved to `reports/` with filenames `position_sizer_YYYY-MM-DD_HHMMSS.json` and `.md`.
Resources
- `references/sizing_methodologies.md`: Comprehensive guide to Fixed Fractional, ATR-based, and Kelly Criterion methods with examples, comparison table, and risk management principles
- `scripts/position_sizer.py`: Main calculation script (CLI interface)
Key Principles
1. **Survival first**: Position sizing is about surviving losing streaks, not maximizing winners 2. **The 1% rule**: Default to 1% risk per trade; never exceed 2% without exceptional reason 3. **Round down**: Always round shares down to whole numbers (never round up) 4. **Strictest constraint wins**: When multiple limits apply, the tightest one determines final size 5. **Half Kelly**: Never use full Kelly in practice; half Kelly captures 75% of growth with far less risk 6. **Portfolio heat**: Total
Read more
name: position-sizer description: Calculate risk-based position sizes for long stock trades. Use when user asks about position sizing, how many shares to buy, risk per trade, Kelly criterion, ATR-based sizing, or portfolio risk allocation. Supports stop-loss distance calculation, volatility scaling, and sector concentration checks.
Position Sizer
Overview
Calculate the optimal number of shares to buy for a long stock trade based on risk management principles. Supports three sizing methods:
- **Fixed Fractional**: Risk a fixed percentage of account equity per trade (default: 1%)
- **ATR-Based**: Use Average True Range to set volatility-adjusted stop distances
- **Kelly Criterion**: Calculate mathematically optimal risk allocation from historical win/loss statistics
All methods apply portfolio constraints (max position %, max sector %) and output a final recommended share count with full risk breakdown.
When to Use
- User asks "how many shares should I buy?"
- User wants to calculate position size for a specific trade setup
- User mentions risk per trade, stop-loss sizing, or portfolio allocation
- User asks about Kelly Criterion or ATR-based position sizing
- User wants to check if a position fits within portfolio concentration limits
Prerequisites
- No API keys required
- Python 3.9+ with standard library only
Workflow
Step 1: Gather Trade Parameters
Collect from the user:
- **Required**: Account size (total equity)
- **Mode A (Fixed Fractional)**: Entry price, stop price, risk percentage (default 1%)
- **Mode B (ATR-Based)**: Entry price, ATR value, ATR multiplier (default 2.0x), risk percentage
- **Mode C (Kelly Criterion)**: Win rate, average win, average loss; optionally entry and stop for share calculation
- **Optional constraints**: Max position % of account, max sector %, current sector exposure
If the user provides a stock ticker but not specific prices, use available tools to look up the current price and suggest entry/stop levels based on technical analysis.
Step 2: Execute Position Sizer Script
Run the position sizing calculation:
# Fixed Fractional (most common) python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --entry 155 \ --stop 148.50 \ --risk-pct 1.0 \ --output-dir reports/ # ATR-Based python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --entry 155 \ --atr 3.20 \ --atr-multiplier 2.0 \ --risk-pct 1.0 \ --output-dir reports/ # Kelly Criterion (budget mode - no entry) python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --win-rate 0.55 \ --avg-win 2.5 \ --avg-loss 1.0 \ --output-dir reports/ # Kelly Criterion (shares mode - with entry/stop) python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --entry 155 \ --stop 148.50 \ --win-rate 0.55 \ --avg-win 2.5 \ --avg-loss 1.0 \ --output-dir reports/
Step 3: Load Methodology Reference
Read `references/sizing_methodologies.md` to provide context on the chosen method, risk guidelines, and portfolio constraint best practices.
Step 4: Calculate Multiple Scenarios
If the user has not specified a single method, run multiple scenarios for comparison:
- Fixed Fractional at 0.5%, 1.0%, and 1.5% risk
- ATR-based at 1.5x, 2.0x, and 3.0x multipliers
- Present a comparison table showing shares, position value, and dollar risk for each
Step 5: Apply Portfolio Constraints and Determine Final Size
Add constraints if the user has portfolio context:
python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --entry 155 \ --stop 148.50 \ --risk-pct 1.0 \ --max-position-pct 10 \ --max-sector-pct 30 \ --current-sector-exposure 22 \ --output-dir reports/
Explain which constraint is binding and why it limits the position.
Step 6: Generate Position Report
Present the final recommendation including:
- Method used and rationale
- Exact share count and position value
- Dollar risk and percentage of account
- Stop-loss price
- Any binding constraints
- Risk management reminders (portfolio heat, loss-cutting discipline)
Output Format
JSON Report
{
"schema_version": "1.0",
"mode": "shares",
"parameters": {
"entry_price": 155.0,
"account_size": 100000,
"stop_price": 148.50,
"risk_pct": 1.0
},
"calculations": {
"fixed_fractional": {
"method": "fixed_fractional",
"shares": 153,
"risk_per_share": 6.50,
"dollar_risk": 1000.0,
"stop_price": 148.50
},
"atr_based": null,
"kelly": null
},
"constraints_applied": [],
"final_recommended_shares": 153,
"final_position_value": 23715.0,
"final_risk_dollars": 994.50,
"final_risk_pct": 0.99,
"binding_constraint": null
}Markdown Report
Generated automatically alongside the JSON report. Contains:
- Parameters summary
- Calculation details for the active method
- Constraints analysis (if any)
- Final recommendation with shares, value, and risk
Reports are saved to `reports/` with filenames `position_sizer_YYYY-MM-DD_HHMMSS.json` and `.md`.
Resources
- `references/sizing_methodologies.md`: Comprehensive guide to Fixed Fractional, ATR-based, and Kelly Criterion methods with examples, comparison table, and risk management principles
- `scripts/position_sizer.py`: Main calculation script (CLI interface)
Key Principles
1. **Survival first**: Position sizing is about surviving losing streaks, not maximizing winners 2. **The 1% rule**: Default to 1% risk per trade; never exceed 2% without exceptional reason 3. **Round down**: Always round shares down to whole numbers (never round up) 4. **Strictest constraint wins**: When multiple limits apply, the tightest one determines final size 5. **Half Kelly**: Never use full Kelly in practice; half Kelly captures 75% of growth with far less risk 6. **Portfolio heat**: Total
Wind 万得金融 Skill 集合(monorepo) · 通过 MCP 协议把万得金融数据接入 Claude / OpenClaw / Hermes 等 AI Agent,并一站式收录 wind 自家数据 + 社区分析工作流共 34 个金融 skill
Other skills on alicemarket.
add_to_winner_decision…
判断盈利仓是否适合继续加仓,并给出加仓前提、节奏安排、保护规则与停止扩张边界。适用于趋势延续、核心持仓滚动放大与强势股二次进攻场景。
after_close_watchlist_…
在收盘后总结自选股当日表现、驱动因素、强弱分化与次日观察点。适用于每日收盘复盘、维护自选股观察节奏、为次日盘前准备提供输入等场景。
avatar-charlie-munger-…
使用查理·芒格式的逆向思考、激励分析、认知偏误叠加和多学科模型检验复杂决策。用于评估商业与投资判断、组织行为、政策效果、重大选择、全民共识、失败风险,或识别论证中的单一视角和心理盲区。
avatar-nassim-taleb-ri…
使用纳西姆·塔勒布式的尾部风险、利益共担、减法、林迪效应和杠铃策略分析不确定性。用于投资、商业、政策、职业、产品或个人决策中的出局风险、不可逆损失、脆弱性、代理问题、新旧方案比较和资源配置。
avatar-naval-ravikant-…
使用纳瓦尔·拉维坎特式的重新定义、欲望审计、特定知识和杠杆框架澄清职业、创业、财富、幸福、自由与人生选择。用于识别错误问题、冲突欲望、独特竞争力、AI替代风险、许可依赖、边际成本和长期复利方向。

