position-sizing

position-sizing is a skill for Claude Code, Codex from marian2js/trading-skills. It costs 31 tokens per session (684 once invoked), scanned A, original, MIT.

A calculation of how many shares, units, or contracts fit within a chosen account risk limit, using the entry price, stop-loss price, and trading costs. Account equity means the current value of the trading account.

In plain words
What is it for?
Use it before entering a trade to calculate an appropriate quantity, test whether the stop makes the trade too large, and account for user-provided costs or extra safety margin.
Why use it?
It replaces gut-feel sizing with arithmetic and shows how fees, slippage, contract multipliers, or a wide stop affect the amount at risk. It does not judge whether the trade idea is good.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it before entering a trade to calculate an appropriate quantity, test whether the stop makes the trade too large, and account for user-provided costs or extra safety margin.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/marian2js/trading-skills/position-sizing
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.

Any agent
npx skills add marian2js/trading-skills --skill position-sizing
Clone the repo
git clone --depth 1 https://github.com/marian2js/trading-skills

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/marian2js/trading-skills/position-sizing/github.svg)](https://agentmods.dev/skills/marian2js/trading-skills/position-sizing)
Your own site
<a href="https://agentmods.dev/skills/marian2js/trading-skills/position-sizing"><img src="https://agentmods.dev/badge/skills/marian2js/trading-skills/position-sizing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for position-sizing

Your own site · 80×15
<a href="https://agentmods.dev/skills/marian2js/trading-skills/position-sizing"><img src="https://agentmods.dev/badge/skills/marian2js/trading-skills/position-sizing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 684 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00031 $0.00684
Opus 5 $0.00015 $0.00342
Sonnet 5 $0.00006 $0.00137
Haiku 4.5 $0.00003 $0.00068

Measured 9d ago against content hash 90f3d6bec350, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

position-sizing 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 9d ago.

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/trade-construction/position-sizing/SKILL.md · 84 lines

How it starts

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

Position Sizing

Use this skill before entering a trade when you need a defensible size instead of a gut-feel size.

This skill will not:

  • tell the user whether the trade thesis is good
  • override liquidity, gap, or event-risk judgment with a formula
  • turn an aggressive stop or oversized conviction into a safe trade

Role

Act like a conservative risk manager. Survival comes before conviction.

When to use it

Use it when the user has a trade idea and needs to know:

  • how many shares, units, or contracts fit the risk budget
  • how slippage, fees, or contract multipliers change the math
  • whether the planned stop makes the size impractical
  • whether the trade is arithmetically small enough before asking whether it is strategically worth taking

Inputs and context

Ask for:

  • account size or equity
  • max risk as percent or cash amount
  • entry price
  • stop price
  • instrument type if it affects contract value
  • optional slippage, commission, or "extra buffer" assumptions

If any key input is missing, state what is missing and stop rather than invent it.

Analysis process

  1. Compute the per-unit risk from entry to stop.
  2. Add user-provided friction assumptions if they materially increase realized risk.
  3. Compute the maximum position size that stays inside the risk budget.
  4. Report the rounded-down size, estimated total risk, and any caveats.
  5. Flag cases where the stop is too tight, too wide, or structurally unclear.

Use references/methodology.md for sizing conventions and caveats. Use assets/trade-plan-template.md when the user wants a reusable planning format.

For agents that support code execution, use references/calculation-helpers.md for the shared helper functions that cover fixed-fractional sizing, volatility-adjusted sizing, Kelly fraction context, and futures contract math.

Output structure

Prefer this output order:

  1. Inputs Used
  2. Sizing Method
  3. Sizing Math
  4. Position Recommendation
  5. Risk Caveats

Read the full file on GitHub · 84 lines

Files

What ships with it

3 files 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. 9d ago First seen · 84 lines · 31 tokens per session scan A 90f3d6bec350

Subscribe to this mod's changes

position-sizing is a skill published in the GitHub repository marian2js/trading-skills (11 stars, last pushed 5mo ago), licensed MIT. It adds 31 tokens to every session and 684 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

tushare

A Python interface for Tushare, a financial data service that provides market and company information for stocks, funds, futures, and digital assets. It returns queried data as pandas tables.

HKUDS/Vibe-Trading · 79 tokens

geopolitical-risk

Geopolitical risk analysis: quantify crisis signals, identify precursors, and build event-driven strategies for war, sanctions, and supply disruption scenarios.

HKUDS/Vibe-Trading · 34 tokens

social-media-intelligence

Social media intelligence: financial signal extraction from Twitter/X, Telegram, Discord, and Reddit for sentiment-driven trading strategies.

HKUDS/Vibe-Trading · 28 tokens

vibe-trading

Professional finance research toolkit — backtesting (10 engines + benchmark comparison panel), factor analysis, Alpha Zoo (462 pre-built alphas across qlib158/alpha101/gtja191/academic/fundamental), options pricing, 90 finance skills, 30 multi-agent swarm teams, Trade Journal analyzer, and Shadow Account (extract →…

HKUDS/Vibe-Trading · 173 tokens

correlation-regime

Correlation-regime detection and crisis attribution — edge-density regime states with hysteresis, causal (no look-ahead) smoothing, regime-aware exposure context, first-mover crisis attribution with honest NAME / MACRO / AMBIGUOUS / ABSTAIN verdicts, and a correlation-rewiring leaderboard that catches slow bleed-outs.

HKUDS/Vibe-Trading · 70 tokens

adr-hshare

ADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.

HKUDS/Vibe-Trading · 50 tokens