position-sizer

Calculate optimal share counts for long stock trades using three sizing methods.

2|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/k1064190/stock-expectation --skill position-sizer-k1064190
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: position-sizer
Source: https://github.com/k1064190/stock-expectation/tree/main/.claude/skills/position-sizer
Command: npx skills add https://github.com/k1064190/stock-expectation --skill position-sizer-k1064190

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps users calculate the optimal number of shares to buy for long stock trades, considering risk management principles and constraints.

Core Features & Use Cases

  • Position Sizing Calculation: Offers three methods for sizing positions: Fixed Fractional, ATR-Based, and Kelly Criterion.
  • Portfolio Constraints: Applies constraints like max position %, max sector %, and current sector exposure.
  • Risk Management: Calculates stop-loss distances, volatility scaling, and sector concentration checks.
  • Use Case: A user wants to buy a stock and needs to determine the optimal number of shares to buy based on their risk tolerance and portfolio constraints.

Quick Start

Use the position-sizer skill to calculate the optimal position size for a trade with an account size of $100,000, entry price of $155, stop price of $148.50, and a risk percentage of 1%.

Frequently Asked Questions about position-sizer

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

FAQPage Schema
How do I calculate optimal position sizes for stock trades?

To calculate optimal position sizes for stock trades, you can use Fixed Fractional, ATR-based, or Kelly Criterion methods. The skill evaluates your risk tolerance, stop-loss distances, and volatility to output a final recommended share count.

What is the best way to apply portfolio constraints to position sizing?

Applying portfolio constraints to position sizing involves checking maximum position percentages, maximum sector percentages, and current sector exposure. This skill enforces these risk management rules to prevent sector concentration and calculate a safe share count.

How does ATR-based sizing work for risk management?

ATR-based sizing works for risk management by using Average True Range to scale position sizes according to market volatility. The skill calculates stop-loss distances and adjusts the recommended share count to align with your predefined risk percentage.

Can I use the Kelly Criterion to determine share count for long stock trades?

Yes, you can use the Kelly Criterion to determine share count for long stock trades. The skill implements this method alongside Fixed Fractional and ATR-based approaches to calculate optimal position sizes based on your specific risk parameters.

What are the limitations of using Python for stock position sizing?

A limitation of using Python for stock position sizing here is that the skill requires Python 3.9 or higher and relies strictly on the standard library. Additionally, it is designed exclusively for long stock trades and does not support short selling.

Do I need external libraries to run position sizing calculations?

No, you do not need external libraries to run position sizing calculations. The skill operates using Python 3.9+ and the standard library only, requiring no external dependencies to compute risk management metrics and recommended share counts.