backtest-expert
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating…
Calculate risk-based position sizes for long stock trades. Use when user asks about position sizing, how many shares to buy, risk per trade, Kelly criterion, ATR-based sizing, or portfolio risk allocation. Supports stop-loss distance calculation, volatility scaling, and sector
$ npx -y skills add BaggaT236/AI-Trading-Skills --skill position-sizer --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/position-sizerContext preview
The summary Claude sees to decide when to auto-load this skill.
Calculate risk-based position sizes for long stock trades. Use when user asks about position sizing, how many shares to buy, risk per trade, Kelly criterion, ATR-based sizing, or portfolio risk allocation. Supports stop-loss distance calculation, volatility scaling, and sector
name: position-sizer description: Calculate risk-based position sizes for long stock trades. Use when user asks about position sizing, how many shares to buy, risk per trade, Kelly criterion, ATR-based sizing, or portfolio risk allocation. Supports stop-loss distance calculation, volatility scaling, and sector concentration checks.
Calculate the optimal number of shares to buy for a long stock trade based on risk management principles. Supports three sizing methods:
All methods apply portfolio constraints (max position %, max sector %) and output a final recommended share count with full risk breakdown.
Collect from the user:
If the user provides a stock ticker but not specific prices, use available tools to look up the current price and suggest entry/stop levels based on technical analysis.
Run the position sizing calculation:
# Fixed Fractional (most common) python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --entry 155 \ --stop 148.50 \ --risk-pct 1.0 \ --output-dir reports/ # ATR-Based python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --entry 155 \ --atr 3.20 \ --atr-multiplier 2.0 \ --risk-pct 1.0 \ --output-dir reports/ # Kelly Criterion (budget mode - no entry) python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --win-rate 0.55 \ --avg-win 2.5 \ --avg-loss 1.0 \ --output-dir reports/ # Kelly Criterion (shares mode - with entry/stop) python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --entry 155 \ --stop 148.50 \ --win-rate 0.55 \ --avg-win 2.5 \ --avg-loss 1.0 \ --output-dir reports/
Read `references/sizing_methodologies.md` to provide context on the chosen method, risk guidelines, and portfolio constraint best practices.
If the user has not specified a single method, run multiple scenarios for comparison:
Add constraints if the user has portfolio context:
python3 skills/position-sizer/scripts/position_sizer.py \ --account-size 100000 \ --entry 155 \ --stop 148.50 \ --risk-pct 1.0 \ --max-position-pct 10 \ --max-sector-pct 30 \ --current-sector-exposure 22 \ --output-dir reports/
Explain which constraint is binding and why it limits the position.
Present the final recommendation including:
{
"schema_version": "1.0",
"mode": "shares",
"parameters": {
"entry_price": 155.0,
"account_size": 100000,
"stop_price": 148.50,
"risk_pct": 1.0
},
"calculations": {
"fixed_fractional": {
"method": "fixed_fractional",
"shares": 153,
"risk_per_share": 6.50,
"dollar_risk": 1000.0,
"stop_price": 148.50
},
"atr_based": null,
"kelly": null
},
"constraints_applied": [],
"final_recommended_shares": 153,
"final_position_value": 23715.0,
"final_risk_dollars": 994.50,
"final_risk_pct": 0.99,
"binding_constraint": null
}Generated automatically alongside the JSON report. Contains:
Reports are saved to `reports/` with filenames `position_sizer_YYYY-MM-DD_HHMMSS.json` and `.md`.
1. **Survival first**: Position sizing is about surviving losing streaks, not maximizing winners 2. **The 1% rule**: Default to 1% risk per trade; never exceed 2% without exceptional reason 3. **Round down**: Always round shares down to whole numbers (never round up) 4. **Strictest constraint wins**: When multiple limits apply, the tightest one determines final size 5. **Half Kelly**: Never use full Kelly in practice; half Kelly captures 75% of growth with far less risk 6. **Portfolio heat**: Total
Build disciplined, repeatable trading workflows with a modern TypeScript platform.
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating…
This skill should be used when analyzing market breadth charts, specifically the S&P 500 Breadth Index (200-Day MA based) and the…
Generate Minervini-style breakout trade plans from VCP screener output with worst-case risk calculation, portfolio heat…
Screen US stocks using William O'Neil's CANSLIM growth stock methodology. Use when user requests CANSLIM stock screening, growth…
Validate data quality in market analysis documents and blog articles before publication. Use when checking for price scale…
Use this skill to find high-quality dividend growth stocks (12%+ annual dividend growth, 1.5%+ yield) that are experiencing…