kelly-position_skill

This skill computes optimal position sizing using the Kelly criterion and provides safe, actionable recommendations for portfolio allocation.
  • Rust

7

GitHub Stars

4

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill louloulin/claude-agent-sdk --skill kelly-position

  • detailed-calculation.md4.2 KB
  • reference-implementation.md7.2 KB
  • reference.md5.4 KB
  • SKILL.md1.4 KB

Overview

This skill calculates position sizes using the Kelly criterion to balance long-term growth against drawdown risk. It supports full Kelly, fractional Kelly (e.g., 1/2 or 1/4 Kelly), and portfolio-level normalization to keep total exposure within limits. Implemented for integration in Rust-based agents, it returns clear numerical recommendations and risk context.

How this skill works

Given inputs like win rate (p), win/loss payoff ratio (b), or statistical estimates (expected return μ and variance σ²), the skill computes the optimal Kelly fraction using the core formulas: full Kelly f* = (b p - q) / b and simplified f = μ / σ². It then applies fractional scaling, enforces configurable min/max position caps, and normalizes across multiple positions for portfolio sizing. The output includes the raw Kelly value, recommended traded fraction, a risk grade, and an explanation of limits.

When to use it

  • When deciding position size for a single trade or strategy after estimating win rate and payoff ratio
  • When you have statistical estimates of expected return and variance and want a variance-based size
  • When you need conservative sizing via fractional Kelly to reduce volatility
  • When managing multiple positions and requiring normalized total exposure
  • When wanting automated, reproducible position-sizing recommendations in a Rust agent

Best practices

  • Prefer fractional Kelly (1/4 or 1/2) for live trading to limit volatility and estimation error
  • Set a hard per-position cap (commonly 20–25%) to avoid concentration risk
  • Treat Kelly < 2% as a signal to skip opening a new position
  • Normalize recommended fractions so portfolio total exposure respects your risk budget
  • Regularly update p, b, μ and σ² with fresh data; estimation error materially affects Kelly outputs

Example use cases

  • Compute full and 1/4-Kelly for a strategy with 60% win rate and 1.5 reward/risk
  • Turn statistical backtest μ and σ² into a variance-based position fraction for automated sizing
  • Normalize individual Kelly recommendations across ten signals to keep total exposure ≤ 50%
  • Automatically enforce minimum size thresholds and per-trade caps before sending orders
  • Provide decision support in a trading assistant implemented in Rust

FAQ

Either win rate (p) and payoff ratio (b), or expected return μ and variance σ². You can also provide custom min/max caps and a fractional multiplier.

How should I pick a fractional Kelly multiplier?

Use 1/4 for conservative live trading and 1/2 for moderate risk tolerance. Lower fractions reduce volatility but also reduce long-term growth.

How does portfolio normalization work?

Individual Kelly fractions are scaled so their sum meets your total exposure limit, preserving relative weights while enforcing the cap.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational