Volatility Percentile Strategy
HKUDS/Vibe-Trading
Mean-reversion signal engine that ranks historical volatility against its own recent history, going long in quiet regimes and exiting or shorting when volatility is high.
Trade sizing methods including fixed fractional, volatility-adjusted, Kelly criterion, and liquidity-constrained sizing
$ npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install agiprolabs/claude-trading-skills position-sizing --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/position-sizing .claude/skills/position-sizing && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "position-sizing" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/position-sizing into .claude/skills/position-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "position-sizing", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/position-sizingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install agiprolabs/claude-trading-skills position-sizing --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/position-sizing .agents/skills/position-sizing && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "position-sizing" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/position-sizing into .agents/skills/position-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "position-sizing", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install agiprolabs/claude-trading-skills position-sizing --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/position-sizing .cursor/skills/position-sizing && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "position-sizing" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/position-sizing into .cursor/skills/position-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "position-sizing", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/agiprolabs/claude-trading-skills.git --path skills/position-sizing--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install agiprolabs/claude-trading-skills position-sizing --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/position-sizing .gemini/skills/position-sizing && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "position-sizing" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/position-sizing into .gemini/skills/position-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "position-sizing", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install agiprolabs/claude-trading-skills position-sizingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/position-sizing .github/skills/position-sizing && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "position-sizing" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/position-sizing into .github/skills/position-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "position-sizing", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install agiprolabs/claude-trading-skills position-sizing --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/position-sizing .opencode/skills/position-sizing && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "position-sizing" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/position-sizing into .opencode/skills/position-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "position-sizing", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
position-sizingTrade sizing methods including fixed fractional, volatility-adjusted, Kelly criterion, and liquidity-constrained sizing
Position Sizing is an agent skill from agiprolabs/claude-trading-skills. Trade sizing methods including fixed fractional, volatility-adjusted, Kelly criterion, and liquidity-constrained sizing
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and reference files (for example `references/practical_guide.md`, `references/sizing_formulas.md` and `scripts/portfolio_sizer.py`).
The repository describes itself as: 68 trading, DeFi, and quantitative finance Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, and 30+ other tools. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 981e1d7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 2 files in scripts/ (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Position Sizing loads about 2.4k tokens when it runs, and up to ~6k if it reads all its reference files. Until then it costs about 34 tokens; SKILL.md has 816 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from agiprolabs/claude-trading-skills at commit 981e1d7, republished under its MIT licence (© agiprolabs). 816 words, ~2,423 tokens.
.claude/skills/position-sizing/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.Position sizing is the single most important risk management decision in trading. Your entry signal determines direction; your position size determines survival. A mediocre strategy with proper sizing will outperform a great strategy with reckless sizing over any meaningful time horizon.
Core principle: Size determines survival, not entries. Two traders with the same signals but different sizing will have wildly different outcomes. The one who sizes conservatively survives drawdowns and compounds capital; the one who oversizes blows up.
| Method | Best For | Key Input |
|---|---|---|
| Fixed Fractional | General trading, most recommended | Account risk % |
| Volatility-Adjusted | Volatile markets, multi-asset | ATR or realized vol |
| Kelly Criterion | Quantified edge with track record | Win rate + payoff ratio |
| Liquidity-Constrained | Low-liquidity Solana tokens | Pool depth |
| Anti-Martingale | Trend-following strategies | Recent P&L streak |
The most recommended method for most traders. Risk a fixed percentage of your account on each trade.
risk_amount = account_value * risk_percentage
price_risk_per_unit = entry_price - stop_loss_price
position_size_units = risk_amount / price_risk_per_unit
position_value = position_size_units * entry_price| Tier | Risk Per Trade | Use Case |
|---|---|---|
| Conservative | 0.5–1% | New strategies, drawdown recovery |
| Standard | 1–2% | Most traders, proven strategies |
| Aggressive | 3–5% | High-conviction setups with strong, measured edge |
account = 10_000 # $10,000 or 100 SOL
risk_pct = 0.02 # 2%
entry = 1.50
stop_loss = 1.30
risk_amount = account * risk_pct # $200
price_risk = entry - stop_loss # $0.20
position_units = risk_amount / price_risk # 1,000 tokens
position_value = position_units * entry # $1,500With this sizing, if the stop loss is hit, you lose exactly 2% of your account regardless of the token's price or volatility.
Scale position size inversely with volatility. When volatility is high, take smaller positions; when low, take larger positions. This normalizes the dollar risk across different market conditions.
adjusted_size = base_size * (target_vol / current_vol)Where:
target_vol: your desired daily portfolio volatility (e.g., 2%)current_vol: the token's current daily volatility (from ATR or realized vol)atr_14 = 0.12 # 14-period ATR
close_price = 1.50
daily_vol_pct = atr_14 / close_price # 8%
target_daily_vol = account * 0.02 # $200 target daily move
position_size = target_daily_vol / atr_14 # 1,667 unitsThis automatically reduces exposure in volatile markets and increases it in calm ones.
The mathematically optimal fraction of capital to risk, maximizing long-term growth rate. Derived from maximizing expected logarithmic utility.
f* = (p * b - q) / bWhere:
p = win rate (probability of winning trade)q = 1 - p (probability of losing trade)b = average win / average loss (payoff ratio)f* = optimal fraction of capital to riskEquivalent form: f* = (p * (b + 1) - 1) / b
Full Kelly assumes perfect knowledge of your edge. In practice, edge estimates are noisy. Always use fractional Kelly:
| Fraction | Use Case | Notes |
|---|---|---|
| 0.25x Kelly | Conservative, recommended default | Robust to edge estimation error |
| 0.50x Kelly | Moderate, for well-measured edges | Still significant drawdown risk |
| 1.0x Kelly | Never in practice | Theoretical maximum, catastrophic if edge is overestimated |
win_rate = 0.55 # 55% win rate
avg_win = 2.0 # Average win is 2x the average loss
avg_loss = 1.0
payoff_ratio = avg_win / avg_loss # b = 2.0
kelly = (win_rate * payoff_ratio - (1 - win_rate)) / payoff_ratio
# kelly = (0.55 * 2.0 - 0.45) / 2.0 = 0.325 = 32.5%
quarter_kelly = kelly * 0.25 # 8.1% — use this
half_kelly = kelly * 0.50 # 16.25%If Kelly is negative, you have no edge. Do not trade.
See references/sizing_formulas.md for the full mathematical derivation.
Critical for Solana tokens. Even if your risk model says you can take a large position, the pool may not support it without unacceptable slippage.
slippage ≈ trade_size / pool_liquidity
max_trade = pool_liquidity * max_slippage_pct| Constraint | Guideline |
|---|---|
| Max single trade | 2% of pool liquidity |
| Max position | 5% of pool liquidity |
| Minimum pool depth | 10x your desired position size |
pool_sol = 500 # 500 SOL in pool
max_slippage = 0.02 # 2% max slippage
max_trade_sol = pool_sol * max_slippage # 10 SOL
# For a $150 SOL price, that's $1,500 max per tradeAlways check all pools, not just the largest. Aggregate liquidity across Raydium, Orca, and Meteora for the full picture. See the liquidity-analysis skill for pool depth assessment.
Increase size after wins, decrease after losses. This is the opposite of the gambler's fallacy (Martingale). The logic: winning streaks may indicate your strategy is in sync with the market; losing streaks may indicate regime change.
def anti_martingale_size(
base_size: float,
consecutive_wins: int,
consecutive_losses: int,
scale_factor: float = 0.25,
max_multiplier: float = 2.0,
min_multiplier: float = 0.5,
) -> float:
if consecutive_losses > 0:
multiplier = max(min_multiplier, 1.0 - consecutive_losses * scale_factor)
elif consecutive_wins > 0:
multiplier = min(max_multiplier, 1.0 + consecutive_wins * scale_factor)
else:
multiplier = 1.0
return base_size * multiplierUse conservatively. After 3+ consecutive losses, reducing size by 50% protects capital during drawdowns.
Combine all methods and take the most conservative result:
1. Calculate Kelly size → theoretical max based on edge
2. Calculate fixed fractional → risk-based size
3. Calculate volatility-adjusted → vol-normalized size
4. Calculate liquidity-constrained max → market-based ceiling
5. Final size = min(all four) → binding constraint winsThe binding constraint tells you what is limiting your size:
Individual position sizing is necessary but not sufficient. You also need portfolio-level constraints:
| Limit | Guideline | Rationale |
|---|---|---|
| Max single position | 10% of portfolio | Diversification floor |
| Max correlated exposure | 25% of portfolio | Correlated assets move together |
| Max total exposure | 50–80% of portfolio | Cash reserve for opportunities/margin |
| Max positions | 5–10 concurrent | Attention and management bandwidth |
PumpFun and early-stage meme tokens require special sizing discipline:
# PumpFun sizing example
account_sol = 100
meme_budget = account_sol * 0.05 # 5 SOL total for memes
per_trade = meme_budget / 10 # 0.5 SOL each, 10 shots| Skill | Integration |
|---|---|
risk-management | Portfolio-level limits, drawdown rules |
liquidity-analysis | Pool depth data for liquidity constraints |
kelly-criterion | Deeper Kelly math, edge estimation |
exit-strategies | Stop loss placement affects fixed fractional sizing |
volatility-modeling | Better vol estimates for volatility-adjusted sizing |
slippage-modeling | Precise slippage estimates for liquidity constraints |
references/sizing_formulas.md — Mathematical derivations for all sizing methods with worked examplesreferences/practical_guide.md — Sizing by account size, token type, and common mistakesscripts/size_calculator.py — Calculates position size using all methods, shows binding constraintscripts/portfolio_sizer.py — Portfolio risk dashboard with per-position risk and available budget# Minimal fixed fractional sizing — copy-paste starter
def calc_position_size(
account: float, risk_pct: float, entry: float, stop: float
) -> float:
"""Return number of units to buy."""
risk_amount = account * risk_pct
price_risk = abs(entry - stop)
if price_risk == 0:
return 0.0
return risk_amount / price_risk© agiprolabs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (scripts, references) in skills/position-sizing of agiprolabs/claude-trading-skills.
Open the folder on GitHubat commit 981e1d7
Position Sizing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Position Sizing this skillagiprolabs/claude-trading-skills | 410 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Volatility Percentile StrategyHKUDS/Vibe-Trading | 35k | — | ~528 | Automated safety check: Pass | MIT | |
| Fixalirezarezvani/claude-skills | 28k | 1 repos | ~765 | Automated safety check: Pass | MIT | |
| Agent Trading Predictorruvnet/ruflo | 74k | 3 repos | ~2.5k | Automated safety check: Pass | MIT | |
| LLM Trading Agent Securityaffaan-m/ECC | 275k | 2 repos | ~1.2k | Automated safety check: Pass | MIT | |
| Trade Journal AnalysisHKUDS/Vibe-Trading | 35k | — | ~1.8k | Automated safety check: Pass | MIT |
HKUDS/Vibe-Trading
Mean-reversion signal engine that ranks historical volatility against its own recent history, going long in quiet regimes and exiting or shorting when volatility is high.
alirezarezvani/claude-skills
Fix failing or flaky Playwright tests. An agent skill from alirezarezvani/claude-skills.
ruvnet/ruflo
Agent skill for trading-predictor - invoke with $agent-trading-predictor
affaan-m/ECC
Security patterns for autonomous trading agents with wallet or transaction authority.
HKUDS/Vibe-Trading
Reads a broker export of your trades (CSV or Excel), builds a trading profile and runs four behavior checks: disposition effect, overtrading, chasing and anchoring.
agentii-ai/agentii-investment-intelligence
volatility trading, VIX products, straddle strangle, vol arbitrage, volatility surface trading, variance swap, gamma scalping, implied vs realized volatility, vol of vol, earnings volatility play
agiprolabs/claude-trading-skills
Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators
agiprolabs/claude-trading-skills
Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity
agiprolabs/claude-trading-skills
Broad crypto market data from CoinGecko covering 13,000+ tokens.
agiprolabs/claude-trading-skills
Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis
agiprolabs/claude-trading-skills
Wallet evaluation, monitoring, and copy-trade strategy design for Solana DEX trading
agiprolabs/claude-trading-skills
Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation
Trade sizing methods including fixed fractional, volatility-adjusted, Kelly criterion, and liquidity-constrained sizing. Position Sizing is an agent skill from agiprolabs/claude-trading-skills.
Run `npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a claude-code`. Or copy the skill folder (skills/position-sizing in agiprolabs/claude-trading-skills) into .claude/skills/position-sizing in your project. Claude Code loads it when a task matches its description.
Run `npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a codex`. Or copy the skill folder (skills/position-sizing in agiprolabs/claude-trading-skills) into .agents/skills/position-sizing in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agiprolabs/claude-trading-skills --skill position-sizing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/position-sizing, .gemini/skills/position-sizing, .github/skills/position-sizing and .opencode/skills/position-sizing in your project.
Going by SKILL.md and its folder, Position Sizing needs Python for the scripts in its folder. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Position Sizing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.6k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Position Sizing: Volatility Percentile Strategy (HKUDS/Vibe-Trading, 35k stars), Fix (alirezarezvani/claude-skills, 28k stars), Agent Trading Predictor (ruvnet/ruflo, 74k stars) and LLM Trading Agent Security (affaan-m/ECC, 275k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
agiprolabs (a GitHub user) maintains it in agiprolabs/claude-trading-skills, which has 410 GitHub stars. The repository holds 68 skills in this directory. The repository was last updated on September 3, 2026.
Source: agiprolabs/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.