position-sizer

position-sizer is a skill for Claude Code, Codex from ntaffzii/Skill-Agents. It costs 103 tokens per session (1,056 once invoked), scanned A, original, MIT.

A calculator for deciding how many shares to buy from account size, acceptable loss, entry price, and stop-loss distance. A stop-loss is a price level used to limit a trade’s loss.

In plain words
What is it for?
Use it for fixed-risk sizing, volatility-based stops using ATR, and Kelly-criterion estimates based on supplied trading statistics.
Why use it?
It turns a chosen risk limit into a position size instead of sizing a trade only by how much cash is available.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ntaffzii/skill-agents/position-sizer
Any agent
npx skills add ntaffzii/Skill-Agents --skill position-sizer
Clone the repo
git clone --depth 1 https://github.com/ntaffzii/Skill-Agents

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for position-sizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/ntaffzii/skill-agents/position-sizer.svg)](https://agentmods.dev/skills/ntaffzii/skill-agents/position-sizer)
Your own site
<a href="https://agentmods.dev/skills/ntaffzii/skill-agents/position-sizer"><img src="https://agentmods.dev/badge/skills/ntaffzii/skill-agents/position-sizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,056 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00103 $0.01056
Opus 5 $0.00051 $0.00528
Sonnet 5 $0.00021 $0.00211
Haiku 4.5 $0.00010 $0.00106

Measured 4d ago against content hash 93c7064e4fee, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

position-sizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (size.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/trading/position-sizer/SKILL.md · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Position Sizer

Overview

"How many shares should I buy?" only has a defensible answer once you know how much you're willing to lose if the stop is hit. This skill does the arithmetic — fixed-fractional risk sizing, ATR-based stop distance, and Kelly criterion — on numbers the user supplies. It does not fetch prices or recommend a trade.

Not financial advice. This calculates how many shares fit a chosen risk budget; it does not evaluate whether the trade itself is a good idea.

When to use

  • คำนวณจำนวนหุ้นที่ควรซื้อ ตามความเสี่ยงที่รับได้ต่อไม้
  • Sizing a position given account equity, entry price, and a stop-loss level
  • Converting ATR (Average True Range) into a volatility-scaled stop and matching position size
  • Estimating a Kelly-criterion fraction from historical win-rate/win-loss stats (as an upper bound, not a recommendation — see Known limitations)

When NOT to use

  • No stop-loss level or risk percentage has been specified — ask for these first; sizing "how many shares fit my account" without a risk budget is really just "how much can I afford," a different question
  • The user wants a signal on whether to take the trade at all — this skill only sizes a trade already decided on

Core knowledge

Fixed-fractional sizing: risk a fixed percentage of account equity per trade.

dollar_risk_per_share = |entry_price - stop_price|
total_risk_amount = account_equity × risk_pct
shares = floor(total_risk_amount / dollar_risk_per_share)

Shares are always rounded down so actual dollar risk never exceeds the budget. Common risk_pct defaults discussed in trading literature range roughly 0.5%-2% per trade — this skill doesn't assert a "correct" number; ask the user or use their stated tolerance.

ATR-based stop: instead of a fixed percentage stop, scale the stop distance to the security's own recent volatility: stop_price = entry_price - (ATR × multiplier), commonly multiplier 1.5-3×. Then size with the same fixed-fractional formula using this derived stop distance.

Read the full file on GitHub · 66 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 66 lines · 103 tokens per session scan A 93c7064e4fee

Subscribe to this mod's changes

position-sizer is a skill published in the GitHub repository ntaffzii/Skill-Agents (4 stars, last pushed 2d ago), licensed MIT. It adds 103 tokens to every session and 1,056 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.