Skip to content
Skills Library
Finance & accounting · Analysis

position-sizer

/position-sizer

Calculate how many shares, futures lots or option lots to trade so that a stop-out loses a fixed percent of the account. Covers Indian and US stocks, NSE index and stock futures and options (lot sizes read live from NSE), MCX commodities (gold, silver, crude, natural gas, copper) and US futures (ES, NQ, GC, SI, CL, NG and micros). Use when the user asks how many shares or lots to buy, how much to risk, what position size fits their stop-loss, or whether an F&O lot is too big for their account.

Licence
MIT
Last repository change
12.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/position_sizer.py

What it does and when to use it

Calculate how many shares, futures lots or option lots to trade so that a stop-out loses a fixed percent of the account. Covers Indian and US stocks, NSE index and stock futures and options (lot sizes read live from NSE), MCX commodities (gold, silver, crude, natural gas, copper) and US futures (ES, NQ, GC, SI, CL, NG and micros). Use when the user asks how many shares or lots to buy, how much to risk, what position size fits their stop-loss, or whether an F&O lot is too big for their account.

Original author description

Calculate how many shares, futures lots or option lots to trade so that a stop-out loses a fixed percent of the account. Covers Indian and US stocks, NSE index and stock futures and options (lot sizes read live from NSE), MCX commodities (gold, silver, crude, natural gas, copper) and US futures (ES, NQ, GC, SI, CL, NG and micros). Use when the user asks how many shares or lots to buy, how much to risk, what position size fits their stop-loss, or whether an F&O lot is too big for their account.

How it works

  1. Run it
  2. What to collect first
  3. Reading the output
  4. Limits
Original SKILL.md headings · 50 lines, 477 words
SKILL.md preview
---
name: position-sizer
description: Calculate how many shares, futures lots or option lots to trade so that a stop-out loses a fixed percent of the account. Covers Indian and US stocks, NSE index and stock futures and options (lot sizes read live from NSE), MCX commodities (gold, silver, crude, natural gas, copper) and US futures (ES, NQ, GC, SI, CL, NG and micros). Use when the user asks how many shares or lots to buy, how much to risk, what position size fits their stop-loss, or whether an F&O lot is too big for their account.
---

# Position Sizer

Sizes a position from risk: `size = (account x risk %) / (distance from entry to stop)`, always rounded down. Run the script; do not do this arithmetic by hand.

## Run it

```bash
# Stock, long: Rs 10 lakh account, risk 1%, buy 500, stop 480, cap the position at 20% of account
python scripts/position_sizer.py --instrument cash --account 1000000 --risk-pct 1 \
  --entry 500 --stop 480 --max-position-pct 20

# Nifty futures: the lot size is fetched live from NSE
python scripts/position_sizer.py --instrument futures --account 1000000 \
  --entry 25000 --stop 24900 --symbol NIFTY --margin-per-contract 250000

# MCX gold mini, or US micro gold: the multiplier comes from the contract table
python scripts/position_sizer.py --instrument futures --account 500000 --entry 125000 --stop 124200 --symbol GOLDM
python scripts/position_sizer.py --instrument futures --account 50000 --risk-pct 2 --entry 3978 --stop 3950 --symbol MGC

# Buying an option: premium 120, planning to exit if it falls to 60
python scripts/position_sizer.py --instrument option --account 1000000 \
  --premium 120 --stop-premium 60 --symbol NIFTY
```

A stop above entry is treated as a short. US fractional shares: add `--fractional-step 0.0001`.

## What to collect first

1. Account size, in the same currency as the instrument (INR for NSE/MCX, USD for US).
2. Risk per trade. If the user has no number, use 1% and say so. Do not suggest more than 2% without the user asking.
3. Entry and stop. If the user has no stop, do not invent one: sizing without a stop is meaningless. Ask where the trade idea is wrong.
4. For futures: the margin per lot from the broker's margin calculator. Without it the script cannot check affordability and says so.

To include costs, get the round-trip cost per unit from the `trade-cost-calculator` skill and pass `--cost-per-unit`.

## Reading the output

- `units`: shares, or lots/contracts. `quantity`: underlying units (lots x lot size).
- `binding_constraint`: `risk`, `max_position_pct`, `margin` or `account_cash` - tell the user which limit set the size.
- `units` of 0 means one share or lot already risks more than the budget. Say that plainly and offer the real options: a smaller contract (mini or micro), a tighter stop, or no trade. Never round up to 1.
- `contract.source_kind`: NSE lots are `primary` (live exchange file). MCX and US futures multipliers come from a table marked `secondary` or `unverified`: tell the user to confirm against the exchange contract page, or pass `--multiplier` themselves.

## Limits

- Option **selling** is not sized here: its loss is not capped by the premium.
- A stop does not guarantee the exit price. Gaps, circuit limits and illiquid options can lose more than the planned amount; mention this for overnight positions.
- The script sizes one position. It does not know about other open positions or correlated risk.
- This calculates size from the user's own plan. It does not recommend the trade.
Files in this package (2)
  • SKILL.md 3 KB
  • scripts/position_sizer.py 4 KB

Versions

RepositoryScoreLicence
This page · krish-vd/claude-quant-skills100MIT
reddygopalkrishna/tradingkit-skills100MIT
Rayhan-099/agy-trading-skills100MIT
tradermonty/claude-trading-skills100MIT
BaggaT236/AI-Trading-Skills100MIT
rgourley/quant-garage90AGPL-3.0

Database snapshot: 13.11.2026 · package version 5102cfbbc8d6 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100india-position-sizer
    Calculate how many shares or F&O lots to trade in Indian markets so that one losing trade costs only a small, fixed part of capital. Includes realistic Indian charges (brokerage, STT, exchange fees, stamp duty, GST, DP charge), reward:risk, profit at target after charges, and a…
  • 100futures-position-sizer
    Calculate contract-based futures position sizes from a direction, entry, and stop-loss, using verified per-symbol contract specs (multiplier, tick size, tick value). Use when the user asks how many futures contracts to trade, wants to size a futures position (ES, NQ, ZB, GC, CL,…
  • 100futures-position-sizer
    Calculate contract-based futures position sizes from a direction, entry, and stop-loss, using verified per-symbol contract specs (multiplier, tick size, tick value). Use when the user asks how many futures contracts to trade, wants to size a futures position (ES, NQ, ZB, GC, CL,…
  • 100market-data
    Fetch market data with no API key - official NSE end-of-day prices (bhavcopy), live NSE F&O lot sizes, official AMFI mutual fund NAVs and scheme search, futures contract specifications (MCX and US), and daily prices for US stocks, ETFs and futures. Use when the user asks for the…
  • 100commodity-regime
    Read the commodity and currency backdrop - trend and one-year range position of gold, silver, copper, WTI and Brent crude, natural gas, platinum, the dollar index and USD/INR; the gold/silver, gold/copper, gold/crude and Brent/WTI ratios with percentiles; and international…
  • 100nse-budget
    NSE Budget Manager for Indian intraday trading, long only, no leverage. Sizes one trade to your capital and your max loss per trade in rupees, NET OF COSTS: the most whole shares whose loss at the stop, with slippage and every charge (brokerage, STT, exchange, SEBI, GST, stamp…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.