position-sizer

Calculate optimal share counts for long stock trades with portfolio constraints.

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/pasie15/claude-trading-skills-marketplace --skill position-sizer-pasie15
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: position-sizer
Source: https://github.com/pasie15/claude-trading-skills-marketplace/tree/main/plugins/trading-portfolio-risk/skills/position-sizer
Command: npx skills add https://github.com/pasie15/claude-trading-skills-marketplace --skill position-sizer-pasie15

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Calculate how many shares to buy for a long stock trade to control dollar risk, enforce portfolio and sector limits, and prevent outsized losses due to poor sizing.

Core Features & Use Cases

  • Fixed Fractional sizing: Risk a fixed percentage of account equity to compute shares from entry and stop.
  • ATR-based volatility sizing: Use ATR and an ATR multiplier to set stop distance and scale position by volatility.
  • Kelly Criterion budgeting: Compute Kelly (and half-Kelly) allocations from win rate and payoff to produce risk budgets or convert to share counts.
  • Portfolio constraints & reporting: Apply max position and sector limits, identify the binding constraint, compare multiple scenarios, and emit JSON and Markdown reports for audit and record-keeping.
  • Use Case: A swing trader wants a side-by-side comparison of fixed-fractional, ATR-based, and Kelly recommendations for a potential trade and needs the final share count that respects a 10% max position and 30% sector cap.

Quick Start

Use the position-sizer to calculate shares for a $100,000 account with entry 155.00, stop 148.50, and 1% risk.

Frequently Asked Questions about position-sizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate position sizing for stock trades using ATR and stop distance?

Position sizing for stock trades is calculated by using ATR and a multiplier to set stop distance, then scaling the share count based on your account equity and dollar risk to produce exact position values. The tool handles this via a Python CLI.

What is the Kelly Criterion and how does it apply to position sizing?

The Kelly Criterion applies to position sizing by computing optimal allocations from your win rate and payoff ratio. It produces risk budgets or converts them directly into share counts, offering full Kelly and half-Kelly calculations for long stock trades.

How do I enforce portfolio constraints like max position and sector limits when sizing trades?

Portfolio constraints like max position and sector limits are enforced by checking your calculated share count against defined caps. The tool identifies the binding constraint and adjusts the final position value to ensure compliance with your portfolio rules.

Can I compare fixed fractional, ATR-based, and Kelly sizing recommendations for a single trade?

Yes, you can compare fixed fractional, ATR-based, and Kelly sizing recommendations side by side. The tool runs multi-scenario comparisons for a single potential trade and outputs the results as JSON and Markdown reports for record-keeping.

Do I need any external Python packages to run position sizing calculations?

No external Python packages are needed to run position sizing calculations. The tool operates entirely on the Python 3.9+ standard library, requiring no additional dependencies to compute share counts and generate reports.

What is fixed fractional position sizing and when should I use it?

Fixed fractional position sizing risks a fixed percentage of account equity to compute shares from your entry and stop prices. Use it when you want consistent dollar risk across trades, regardless of stock volatility or market conditions.