Agent skill

Position Sizer

by tradermonty in tradermonty/claude-trading-skills

Calculate risk-based position sizes for long stock trades. An agent skill from tradermonty/claude-trading-skills.

MITAuto-check passed

Install Position Sizer

skills CLI
$ npx skills add tradermonty/claude-trading-skills --skill position-sizer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tradermonty/claude-trading-skills position-sizer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tradermonty/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/position-sizer .claude/skills/position-sizer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
position-sizer
GitHub stars
3k
Used in
3 other repos
Token cost
~1.9k tokens
SKILL.md length
694 words
Files
6 (incl. scripts, references)
Skills in repo
74
Repo updated
First seen
Licence
MIT

At a glance

Calculate risk-based position sizes for long stock trades. An agent skill from tradermonty/claude-trading-skills.

  • Works in 6 steps: Gather Trade Parameters → Execute Position Sizer Script → Load Methodology Reference → …
  • User asks about position sizing
  • SKILL.md covers Overview, When to Use, Prerequisites and Workflow, plus 3 more sections
  • Runs Python scripts from its folder; calls python3

What it does

Position Sizer is an agent skill from tradermonty/claude-trading-skills. 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.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `references/sizing_methodologies.md`, `scripts/position_sizer.py` and `scripts/tests/conftest.py`).

The repository describes itself as: Claude Code skills for equity investors and traders — market analysis, technical charting, economic calendars, screeners, and trading strategy development. The licence is MIT.

When your agent uses it

  • User asks about position sizing
  • How many shares to buy
  • Kelly criterion
  • ATR-based sizing

Example prompts

  • “/position-sizer”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Gather Trade Parameters
  2. Execute Position Sizer Script
  3. Load Methodology Reference
  4. Calculate Multiple Scenarios
  5. Apply Portfolio Constraints and Determine Final Size
  6. Generate Position Report

What it can do on your machine

Read from SKILL.md and the folder at commit eab8d5c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Position Sizer loads about 1.9k tokens when it runs, and up to ~5k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 694 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from tradermonty/claude-trading-skills at commit eab8d5c, republished under its MIT licence (© tradermonty). 694 words, ~1,870 tokens.

Download SKILL.mdSave it as .claude/skills/position-sizer/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
position-sizer
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.

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
  • 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

If the user provides a stock ticker but not specific prices, use available tools to look up the current price and suggest entry/stop levels based on technical analysis.

Step 2: Execute Position Sizer Script

Run the position sizing calculation:

bash
# Fixed Fractional (most common)
python3 skills/position-sizer/scripts/position_sizer.py \
  --account-size 100000 \
  --entry 155 \
  --stop 148.50 \
  --risk-pct 1.0 \
  --output-dir reports/

# Fractional shares for small accounts or high-priced stocks
python3 skills/position-sizer/scripts/position_sizer.py \
  --account-size 1000 \
  --entry 155 \
  --stop 148.50 \
  --risk-pct 1.0 \
  --fractional \
  --share-precision 4 \
  --output-dir reports/

# ATR-Based
python3 skills/position-sizer/scripts/position_sizer.py \
  --account-size 100000 \
  --entry 155 \
  --atr 3.20 \
  --atr-multiplier 2.0 \
  --risk-pct 1.0 \
  --output-dir reports/

# Kelly Criterion (budget mode - no entry)
python3 skills/position-sizer/scripts/position_sizer.py \
  --account-size 100000 \
  --win-rate 0.55 \
  --avg-win 2.5 \
  --avg-loss 1.0 \
  --output-dir reports/

# Kelly Criterion (shares mode - with entry/stop)
python3 skills/position-sizer/scripts/position_sizer.py \
  --account-size 100000 \
  --entry 155 \
  --stop 148.50 \
  --win-rate 0.55 \
  --avg-win 2.5 \
  --avg-loss 1.0 \
  --output-dir reports/
Step 3: Load Methodology Reference

Read references/sizing_methodologies.md to provide context on the chosen method, risk guidelines, and portfolio constraint best practices.

Step 4: Calculate Multiple Scenarios

If the user has not specified a single method, run multiple scenarios for comparison:

  • Fixed Fractional at 0.5%, 1.0%, and 1.5% risk
  • ATR-based at 1.5x, 2.0x, and 3.0x multipliers
  • Present a comparison table showing shares, position value, and dollar risk for each
Step 5: Apply Portfolio Constraints and Determine Final Size

Add constraints if the user has portfolio context:

bash
python3 skills/position-sizer/scripts/position_sizer.py \
  --account-size 100000 \
  --entry 155 \
  --stop 148.50 \
  --risk-pct 1.0 \
  --max-position-pct 10 \
  --max-sector-pct 30 \
  --current-sector-exposure 22 \
  --output-dir reports/

Explain which constraint is binding and why it limits the position.

Show full SKILL.md (293 more words)Show less
Step 6: Generate Position Report

Present the final recommendation including:

  • Method used and rationale
  • Exact share count and position value
  • Dollar risk and percentage of account
  • Stop-loss price
  • Any binding constraints
  • Risk management reminders (portfolio heat, loss-cutting discipline)
  • Small-account reminders: fractional shares do not remove broker minimums, spread/slippage, commissions/fees, margin limits, borrow availability, or day-trading controls

Output Format

JSON Report
json
{
  "schema_version": "1.0",
  "mode": "shares",
  "parameters": {
    "entry_price": 155.0,
    "account_size": 100000,
    "stop_price": 148.50,
    "risk_pct": 1.0
  },
  "calculations": {
    "fixed_fractional": {
      "method": "fixed_fractional",
      "shares": 153,
      "risk_per_share": 6.50,
      "dollar_risk": 1000.0,
      "stop_price": 148.50
    },
    "atr_based": null,
    "kelly": null
  },
  "constraints_applied": [],
  "final_recommended_shares": 153,
  "final_position_value": 23715.0,
  "final_risk_dollars": 994.50,
  "final_risk_pct": 0.99,
  "binding_constraint": null
}
Markdown Report

Generated automatically alongside the JSON report. Contains:

  • Parameters summary
  • Calculation details for the active method
  • Constraints analysis (if any)
  • Final recommendation with shares, value, and risk

Reports are saved to reports/ with filenames position_sizer_YYYY-MM-DD_HHMMSS.json and .md.

Resources

  • references/sizing_methodologies.md: Comprehensive guide to Fixed Fractional, ATR-based, and Kelly Criterion methods with examples, comparison table, and risk management principles
  • scripts/position_sizer.py: Main calculation script (CLI interface)

Key Principles

  1. Survival first: Position sizing is about surviving losing streaks, not maximizing winners
  2. The 1% rule: Default to 1% risk per trade; never exceed 2% without exceptional reason
  3. Default to whole shares: Existing workflows remain integer-share by default
  4. Floor, never round up: Whole-share mode floors to an integer; fractional mode floors to the requested precision so risk and concentration budgets are not exceeded
  5. Strictest constraint wins: When multiple limits apply, the tightest one determines final size
  6. Half Kelly: Never use full Kelly in practice; half Kelly captures 75% of growth with far less risk
  7. Portfolio heat: Total open risk should not exceed 6-8% of account equity
  8. Intraday rules are broker-specific: FINRA replaced the old pattern-day-trader day-count and $25,000 minimum-equity requirements with intraday margin standards effective 2026-06-04, with broker phase-in allowed through 2027-10-20. Check the broker's current rules before repeated same-day trading in a margin account.
  9. Asymmetry of losses: A 50% loss requires a 100% gain to recover; size accordingly

© tradermonty, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/position-sizer of tradermonty/claude-trading-skills.

  • SKILL.md
  • references/sizing_methodologies.md
  • requirements.txt
  • scripts/position_sizer.py
  • scripts/tests/conftest.py
  • scripts/tests/test_position_sizer.py

Open the folder on GitHubat commit eab8d5c

Used in 3 other repositories

We found 4 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in tradermonty/claude-trading-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Position Sizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Position Sizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Position Sizer this skilltradermonty/claude-trading-skills3k3 repos~1.9kAutomated safety check: PassMIT
Prediction Market Risk Reviewaffaan-m/ECC275k1 repos~471Automated safety check: PassMIT
Trader Riskruvnet/ruflo74k1 repos~358Automated safety check: NotesMIT
Vibe-Trading Finance ToolkitHKUDS/Vibe-Trading35k—~6.5kAutomated safety check: PassMIT
Portfolio Risk Metricswshobson/agents40k13 repos~502Automated safety check: PassMIT
Trade Riskzubair-trabzada/ai-trading-claude267—~4.8kAutomated safety check: PassMIT

Similar skills

  • Review prediction-market, basket, oracle, and trading-agent workflows for compliance, safety, data-quality, privacy, and execution risk.

    275k GitHub starsUsed in 1 repo~471 tokens
    Data & AnalyticsAuto-check passed
  • Trader Risk

    ruvnet/ruflo

    Assess portfolio risk using npx neural-trader — VaR, CVaR, Sharpe, position sizing, circuit breaker status

    74k GitHub starsUsed in 1 repo~358 tokens
    Auto-check: notes
  • Finance research toolkit with backtesting, factor analysis, a library of prebuilt alphas, options pricing and a Shadow Account loop that tests rules extracted from your trade journal.

    35k GitHub stars~6.5k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Portfolio Risk Metrics

    wshobson/agents

    Covers portfolio risk measurement with VaR, CVaR, Sharpe, Sortino and drawdown, plus guidance on limits, stress tests and tail risk.

    40k GitHub starsUsed in 13 repos~502 tokens
    Business, Finance & HRAuto-check passed
  • Trade Risk

    zubair-trabzada/ai-trading-claude

    Risk Assessment & Position Sizing — analyzes volatility, drawdown scenarios, correlation, liquidity, and provides position sizing calculators (Kelly Criterion, fixed percentage, volatility-adjusted)…

    267 GitHub stars~4.8k tokensUpdated 6 mo ago
    Legal & ComplianceAuto-check passed
  • Agent skill for trading-predictor - invoke with $agent-trading-predictor

    74k GitHub starsUsed in 3 repos~2.5k tokens
    Business, Finance & HRAuto-check passed

More from tradermonty/claude-trading-skills

All 74 skills in this repo
  • Technical Analyst

    tradermonty/claude-trading-skills

    This skill should be used when analyzing weekly price charts for stocks, stock indices, cryptocurrencies, or forex pairs.

    3k GitHub starsUsed in 5 repos~4.6k tokens
    Auto-check passed
  • Trader Memory Core

    tradermonty/claude-trading-skills

    Track investment theses across their lifecycle — from screening idea to closed position with postmortem.

    3k GitHub starsUsed in 3 repos~4.3k tokens
    Auto-check passed
  • Theme Detector

    tradermonty/claude-trading-skills

    Detect and analyze trending market themes across sectors. An agent skill from tradermonty/claude-trading-skills.

    3k GitHub starsUsed in 2 repos~4.9k tokens
    Auto-check passed
  • Edge Strategy Reviewer

    tradermonty/claude-trading-skills

    Critically review strategy drafts from edge-strategy-designer for edge plausibility, overfitting risk, sample size adequacy, and execution realism.

    3k GitHub starsUsed in 1 repo~988 tokens
    Auto-check passed
  • Sector Analyst

    tradermonty/claude-trading-skills

    This skill should be used when analyzing sector rotation patterns and market cycle positioning.

    3k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Stanley Druckenmiller Investment

    tradermonty/claude-trading-skills

    Druckenmiller Strategy Synthesizer - Integrates 8 upstream skill outputs (Market Breadth, Uptrend Analysis, Market Top, Macro Regime, FTD Detector, VCP Screener, Theme Detector, CANSLIM Screener)…

    3k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed

Questions about Position Sizer

What does Position Sizer do?

Calculate risk-based position sizes for long stock trades. An agent skill from tradermonty/claude-trading-skills. Position Sizer is an agent skill from tradermonty/claude-trading-skills. Calculate risk-based position sizes for long stock trades.

When should I use Position Sizer?

Position Sizer fits situations like: user asks about position sizing; how many shares to buy; kelly criterion; ATR-based sizing.

How do I install Position Sizer in Claude Code?

Run `npx skills add tradermonty/claude-trading-skills --skill position-sizer -a claude-code`. Or copy the skill folder (skills/position-sizer in tradermonty/claude-trading-skills) into .claude/skills/position-sizer in your project. Claude Code loads it when a task matches its description.

How do I install Position Sizer in Codex?

Run `npx skills add tradermonty/claude-trading-skills --skill position-sizer -a codex`. Or copy the skill folder (skills/position-sizer in tradermonty/claude-trading-skills) into .agents/skills/position-sizer in your project. Codex loads it when a task matches its description.

Can I use Position Sizer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tradermonty/claude-trading-skills --skill position-sizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/position-sizer, .gemini/skills/position-sizer, .github/skills/position-sizer and .opencode/skills/position-sizer in your project.

What does Position Sizer need to run?

Going by SKILL.md and its folder, Position Sizer needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Position Sizer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Position Sizer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Position Sizer use?

Position Sizer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Position Sizer use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to Position Sizer?

Skills that share tags, products or a category with Position Sizer: Prediction Market Risk Review (affaan-m/ECC, 275k stars), Trader Risk (ruvnet/ruflo, 74k stars), Vibe-Trading Finance Toolkit (HKUDS/Vibe-Trading, 35k stars) and Portfolio Risk Metrics (wshobson/agents, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Position Sizer?

tradermonty (a GitHub user) maintains it in tradermonty/claude-trading-skills, which has 2,960 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 5, 2026.

Source: tradermonty/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.