Calculates how many shares to buy based on your account size, entry price, and stop loss using three methods: fixed fractional (risk 1% per trade), ATR-based volatility sizing, or Kelly Criterion from your win/loss stats. Takes optional constraints like max position size or sector concentration and tells you which limit is binding. Outputs both JSON and markdown reports with exact shares, dollar risk, and position value. The methodology reference is solid on why you should basically never risk more than 2% per trade and always use half Kelly if you're going that route. No API keys needed, just Python standard library. Good for anyone who wants to stop guessing at position sizes and actually manage risk consistently.

skills.sh installs
4.1K
GitHub stars
3.7K
last updated
Aug 21, 2026

Install

$ npx -y skills add tradermonty/claude-trading-skills --skill position-sizer --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Sponsors

Details

Repository
github.com/tradermonty/claude-trading-skills
Category
Finance & Trading
First seen
Jun 3, 2026

More from tradermonty/claude-trading-skills

All 54
1tradermonty avatarvalue-dividend-screenertradermonty/claude-trading-skillsScreen US stocks for high-quality dividend opportunities combining value characteristics (P/E ratio under 20, P/B ratio under 2), attractive yields (3% or highe4Kskills.sh installs
2affaan-m avataragent-payment-x402affaan-m/everything-claude-codeagent payment x4023.9Kskills.sh installs
3longbridge avatarlongbridge-derivativeslongbridge/skillsOptions chains, option quotes, option volume, Greeks (Delta/Gamma/Theta/Vega), implied volatility, and HK warrants (callable bull/bear, call/put warrants, issue3.9Kskills.sh installs
4tradermonty avatarinstitutional-flow-trackertradermonty/claude-trading-skillsUse this skill to track institutional investor ownership changes and portfolio flows using 13F filings data. Analyzes hedge funds, mutual funds, and other insti3.8Kskills.sh installs
5affaan-m avatarfinance-billing-opsaffaan-m/everything-claude-codefinance billing ops3.7Kskills.sh installs
6tradermonty avatarpair-trade-screenertradermonty/claude-trading-skillsStatistical arbitrage tool for identifying and analyzing pair trading opportunities. Detects cointegrated stock pairs within sectors, analyzes spread behavior, 3.6Kskills.sh installs