position-sizer
/position-sizer
Calculate exactly how much to buy or sell - fixed-fractional risk sizing from entry and stop, risk-amount sizing, lot/contract sizes with futures multipliers and margin, fractional crypto units, position-size tables, Kelly fraction, volatility-target sizing and risk-of-ruin. Pure math, no data or API needed. Use when the user asks "how many shares/lots/coins", "how much should I risk", "what if I risk 2%", about Kelly criterion, or leverage and margin math.
- Author
- reddygopalkrishna ↗
- Repository
- tradingkit-skills ↗
- Licence
- MIT
- Last repository change
- 08.11.2026
Assessment and security
- Files in this package
- 23
- Scripts
- 22
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 08.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 22 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/_vendor/tradekit/__init__.py, scripts/_vendor/tradekit/analysis.py, scripts/_vendor/tradekit/backtest.py, scripts/_vendor/tradekit/brokers/__init__.py, scripts/_vendor/tradekit/brokers/base.py, scripts/_vendor/tradekit/brokers/kite.py, scripts/_vendor/tradekit/brokers/paper.py, scripts/_vendor/tradekit/cli.py, scripts/_vendor/tradekit/config.py, scripts/_vendor/tradekit/data.py, scripts/_v
What it does and when to use it
Calculate exactly how much to buy or sell - fixed-fractional risk sizing from entry and stop, risk-amount sizing, lot/contract sizes with futures multipliers and margin, fractional crypto units, position-size tables, Kelly fraction, volatility-target sizing and risk-of-ruin. Pure math, no data or API needed. Use when the user asks "how many shares/lots/coins", "how much should I risk", "what if I risk 2%", about Kelly criterion, or leverage and margin math.
Triggers from the description
Original author description
Calculate exactly how much to buy or sell - fixed-fractional risk sizing from entry and stop, risk-amount sizing, lot/contract sizes with futures multipliers and margin, fractional crypto units, position-size tables, Kelly fraction, volatility-target sizing and risk-of-ruin. Pure math, no data or API needed. Use when the user asks "how many shares/lots/coins", "how much should I risk", "what if I risk 2%", about Kelly criterion, or leverage and margin math.
How it works
- Formula
- Guidance to give
SKILL.md preview
--- name: position-sizer description: Calculate exactly how much to buy or sell - fixed-fractional risk sizing from entry and stop, risk-amount sizing, lot/contract sizes with futures multipliers and margin, fractional crypto units, position-size tables, Kelly fraction, volatility-target sizing and risk-of-ruin. Pure math, no data or API needed. Use when the user asks "how many shares/lots/coins", "how much should I risk", "what if I risk 2%", about Kelly criterion, or leverage and margin math. license: MIT metadata: author: reddygopalkrishna version: "0.1.0" pack: tradingkit-skills --- # Position Sizer The single most important number in a trade is its size. This skill never guesses it. ```bash python3 scripts/size.py risk --equity 50000 --entry 120 --stop 114 --risk-pct 1 python3 scripts/size.py risk --equity 50000 --entry 120 --stop 114 --risk-amount 400 --target 135 python3 scripts/size.py risk --equity 2000000 --entry 22500 --stop 22350 --lot 50 --margin-pct 12 # futures lot python3 scripts/size.py risk --equity 10000 --entry 64000 --stop 61000 --fractional --lot 0.0001 # crypto python3 scripts/size.py table --equity 50000 --entry 120 --stop 114 # 0.25% .. 2% side by side python3 scripts/size.py kelly --win-rate 0.45 --payoff 2.2 python3 scripts/size.py vol --equity 100000 --price 50 --annual-vol 35 --target-vol 10 python3 scripts/size.py ruin --win-rate 0.45 --payoff 2 --risk-pct 1 --ruin-pct 30 ``` `--equity` defaults to config `account.equity`; `--risk-pct` defaults to `risk.risk_per_trade_pct`. ## Formula `qty = floor_to_lot( equity x risk% / (|entry - stop| x multiplier + fee_per_unit) )`, then capped by `--max-position-pct` and `--cash`. The output names the **binding constraint** (risk, max_position or cash) - when it is not "risk", the actual risk is lower than requested. - **Futures/F&O:** `--multiplier` = point value per contract unit, `--lot` = exchange lot size, `--margin-pct` = margin as % of notional (affects capital required, not risk). - **Options:** size on premium at risk: entry = premium paid, stop = premium exit level, `--multiplier` = contract size. - **Crypto:** `--fractional --lot 0.0001`. ## Guidance to give - 0.5-1% risk per trade is the common professional range; 2% is aggressive. - Show the `table` when the user is unsure - it makes the trade-off visible (`losses_to_-20%` = losing streak that produces a 20% drawdown). - Kelly assumes the edge is known exactly. Recommend at most quarter-Kelly, and never Kelly on a backtest with fewer than ~100 trades.
Files in this package (23)
- SKILL.md 2 KB
- scripts/size.py 7 KB
- scripts/_vendor/tradekit/__init__.py 1 KB
- scripts/_vendor/tradekit/analysis.py 10 KB
- scripts/_vendor/tradekit/backtest.py 18 KB
- scripts/_vendor/tradekit/cli.py 2 KB
- scripts/_vendor/tradekit/config.py 5 KB
- scripts/_vendor/tradekit/data.py 15 KB
- scripts/_vendor/tradekit/expr.py 19 KB
- scripts/_vendor/tradekit/frame.py 9 KB
- scripts/_vendor/tradekit/gate.py 8 KB
- scripts/_vendor/tradekit/http.py 4 KB
- scripts/_vendor/tradekit/indicators.py 13 KB
- scripts/_vendor/tradekit/journal.py 11 KB
- scripts/_vendor/tradekit/metrics.py 6 KB
- scripts/_vendor/tradekit/montecarlo.py 8 KB
- scripts/_vendor/tradekit/patterns.py 13 KB
- scripts/_vendor/tradekit/report.py 8 KB
- scripts/_vendor/tradekit/risk.py 5 KB
- scripts/_vendor/tradekit/brokers/__init__.py 1 KB
- scripts/_vendor/tradekit/brokers/base.py 3 KB
- scripts/_vendor/tradekit/brokers/kite.py 15 KB
- scripts/_vendor/tradekit/brokers/paper.py 13 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · reddygopalkrishna/tradingkit-skills | 100 | MIT |
| krish-vd/claude-quant-skills | 100 | MIT |
| Rayhan-099/agy-trading-skills | 100 | MIT |
| tradermonty/claude-trading-skills | 100 | MIT |
| BaggaT236/AI-Trading-Skills | 100 | MIT |
| rgourley/quant-garage | 90 | AGPL-3.0 |
Database snapshot: 13.11.2026 · package version 2978ebcc841e (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
- 100position-sizing
Use when deciding how large a position to take. Covers fixed-fractional risk, volatility-based sizing, the Kelly criterion and why to fractionalize it, and portfolio concentration limits. Trigger on "how much should i put in this trade", "how many shares should i buy", "should i… - 100sizing
Turns an expected return and a risk estimate into a position size using fractional Kelly, a volatility target, and a maximum weight. Use when asked how large a position should be, how to size or scale a strategy, what the Kelly fraction is, or how to bring a position to a target volatility. - 100position-sizing
Position sizing for Indian equity and F&O trades: fixed-fractional risk sizing with round-trip costs included, ATR-based stops, F&O lot rounding and margin checks, MTF/intraday leverage adjustment, gap-through-stop and circuit risk, Kelly from a trade journal, and portfolio… - 100bet-sizing
Determine how much capital to allocate to individual positions within a portfolio. Use when the user asks about position sizing, the Kelly criterion, fractional Kelly, risk budgeting, or conviction weighting. Also trigger when users mention 'how much to put in one stock',… - 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,…