position-sizing

position-sizing is a skill for Claude Code, Codex from Bhala-Srinivash/nse-trading-skills. It costs 96 tokens per session (1,040 once invoked), scanned A, original, MIT.

A calculator for deciding how many shares to buy in NSE or BSE equity trades while limiting the amount at risk. It includes fixed-fractional, ATR-based, and Kelly-based methods; ATR measures typical price movement.

In plain words
What is it for?
Calculating share quantities, required capital, and risk-adjusted trade sizes, while optionally checking volatility, leverage, and existing portfolio concentration.
Why use it?
Buying a fixed amount of stock can make one trade risk far more than another. These methods connect position size to the account, entry price, stop-loss, volatility, and leverage.

Skill for Claude CodeCodex

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

Good fit Calculating share quantities, required capital, and risk-adjusted trade sizes, while optionally checking volatility, leverage, and existing portfolio concentration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bhala-srinivash/nse-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 Bhala-Srinivash/nse-trading-skills --skill position-sizing
Clone the repo
git clone --depth 1 https://github.com/Bhala-Srinivash/nse-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/bhala-srinivash/nse-trading-skills/position-sizing/github.svg)](https://agentmods.dev/skills/bhala-srinivash/nse-trading-skills/position-sizing)
Your own site
<a href="https://agentmods.dev/skills/bhala-srinivash/nse-trading-skills/position-sizing"><img src="https://agentmods.dev/badge/skills/bhala-srinivash/nse-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/bhala-srinivash/nse-trading-skills/position-sizing"><img src="https://agentmods.dev/badge/skills/bhala-srinivash/nse-trading-skills/position-sizing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,040 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.00096 $0.01040
Opus 5 $0.00048 $0.00520
Sonnet 5 $0.00019 $0.00208
Haiku 4.5 $0.00010 $0.00104

Measured 12d ago against content hash dda972fd4c7d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 12d 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.

position-sizing/SKILL.md · 128 lines

How it starts

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

Position Sizing

Position sizing is how you survive. The goal: risk a small, consistent percentage of capital per trade so that no single loss can cripple your account.

Prerequisites

No dependencies required. Works with manually provided prices. Enhanced with Groww MCP (live price, ATR, portfolio) or yfinance (pip install yfinance).

Data Needed

  1. Account size: Total trading capital (ask user if not known)
  2. Current price: get_quotes_and_depth from Groww, or user-provided
  3. ATR(14): get_historical_technical_indicators from Groww, or calculate from candle data
  4. Existing positions: get_equity_portfolio_holdings to check concentration (optional)

Method 1: Fixed Fractional (Default)

This is the go-to method. Simple, robust, works for everyone.

Risk per trade = Account size × Risk%
Shares = Risk per trade ÷ (Entry price - Stop-loss price)
Capital required = Shares × Entry price

Risk% guidelines:

Situation Risk%
Normal (no leverage) 1-2%
With 2x leverage 0.5-1%
With 3-4x leverage 0.25-0.5%
High conviction trade Up to 3% (rare)
New/uncertain setup 0.5%

Example

Account: Rs.10,00,000
Risk: 2% = Rs.20,000
Entry: Rs.1,800
Stop: Rs.1,700 (Rs.100 risk per share)
Shares: 20,000 ÷ 100 = 200 shares
Capital: 200 × 1,800 = Rs.3,60,000 (36% of account)

Method 2: ATR-Based Sizing

Uses volatility to set the stop distance, then sizes accordingly.

Stop distance = ATR(14) × multiplier
Shares = Risk amount ÷ Stop distance
Market Condition ATR Multiplier
Low volatility (ADX < 20) 1.5× ATR
Normal volatility 2.0× ATR
High volatility (ADX > 30) 2.5× ATR

This naturally sizes you smaller in volatile stocks and larger in calm ones.

Method 3: Kelly Criterion (Advanced)

For traders with a track record of at least 30 trades:

Kelly% = W - (1 - W) / R
W = historical win rate
R = average win / average loss

Use Half-Kelly (Kelly% ÷ 2) for real trading — full Kelly is too aggressive.

Read the full file on GitHub · 128 lines

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. 12d ago First seen · 128 lines · 96 tokens per session scan A dda972fd4c7d

Subscribe to this mod's changes

position-sizing is a skill published in the GitHub repository Bhala-Srinivash/nse-trading-skills (38 stars, last pushed 6mo ago), licensed MIT. It adds 96 tokens to every session and 1,040 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-30.

Related

Other skills, from other repositories

ib-pmcc-advisor

Analyze PMCC (Poor Man's Covered Call / diagonal spread) positions from IB portfolio. For each diagonal spread, reports short leg risk (delta, IV, assignment probability), daily P&L projections, top-3 roll candidates, and a side-by-side comparison table. Requires TWS or IB Gateway running locally.

staskh/trading_skills · 71 tokens

scanner-pmcc

Scan stocks for Poor Man's Covered Call (PMCC) suitability. Analyzes LEAPS and short call options for delta, liquidity, spread, IV, yield, trend direction, and earnings proximity. Use when user asks about PMCC candidates, diagonal spreads, or LEAPS strategies.

staskh/trading_skills · 63 tokens

ib-stop-loss

Downside stop-loss management for PMCC, naked LEAPS, and stock positions in IB. Computes stop prices, detects alerts, and places conditional combo orders. Dry-run by default. Requires TWS or IB Gateway running locally.

staskh/trading_skills · 50 tokens

ib-trailing-stop

Server-side trailing stop management for stocks and naked LEAPS in IB. Places native TRAIL orders that auto-ratchet the stop as price climbs. Dry-run by default. Requires TWS or IB Gateway running locally.

staskh/trading_skills · 49 tokens

ib-collar

Generate tactical collar strategy reports for protecting PMCC positions through earnings or high-risk events. Requires TWS or IB Gateway running locally.

staskh/trading_skills · 30 tokens

ib-find-short-roll

Find roll options for existing short positions OR find best covered call/put to open against long stock. Use when user asks about rolling shorts, finding roll candidates, writing covered calls, or managing option positions. Requires TWS or IB Gateway running locally.

staskh/trading_skills · 55 tokens