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 concentration checks.
npx skills add BaggaT236/AI-Trading-Skills --skill position-sizer --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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 (d
- Overview
- When to Use
- Prerequisites
- Workflow
- Step 1: Gather Trade Parameters
- Step 2: Execute Position Sizer Script
- Step 3: Load Methodology Reference
- Step 4: Calculate Multiple Scenarios
- Step 5: Apply Portfolio Constraints and Determine Final Size
- Step 6: Generate Position Report
- Output Format
- JSON Report
- Markdown Report
- Resources
Fixed Fractional (most common) python3 skills/position-sizer/scripts/position_sizer.py \ ATR-Based Kelly Criterion (budget mode - no entry) Kelly Criterion (shares mode - with entry/stop)
What does the position-sizer skill do?
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.
How do I install it?
Run `npx skills add BaggaT236/AI-Trading-Skills --skill position-sizer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BaggaT236/AI-Trading-Skills, a repository with 118 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
