# Position Sizer

Calculate risk-based position sizes for long stock trades.

- Repository: https://github.com/tradermonty/claude-trading-skills (3536 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add tradermonty/claude-trading-skills --skill position-sizer -g -a claude-code -y`
Codex: `npx skills add tradermonty/claude-trading-skills --skill position-sizer -g -a codex -y`
Cursor: `npx skills add tradermonty/claude-trading-skills --skill position-sizer -g -a cursor -y`
Gemini CLI: `npx skills add tradermonty/claude-trading-skills --skill position-sizer -g -a gemini-cli -y`

## 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, fractional-share sizing, or portfolio risk allocation. Supports stop-loss distance calculation, volatility scaling, and sector concentration checks.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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. The default output is whole shares. Use `--fractional` only when the user's broker supports fractional shares for the security and order type.

## 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 has a small account where whole-share rounding would under-deploy a defined risk budget
- 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
- **Stop constraint**: `--stop` must be positive and below `--entry`
- **Optional constraints**: Max position % of account, max sector %, current sector exposure
- **Optional share mode**: Whole shares by default, or fractional shares with `--fractional --share-precision N` when supported by the broker

The rest: https://github.com/tradermonty/claude-trading-skills/blob/HEAD/skills/position-sizer/SKILL.md
