Tushare Data
zillionare/zillionare
面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。
Kelly criterion optimal sizing with fractional variants, edge estimation, and practical application for crypto trading
$ npx skills add agiprolabs/claude-trading-skills --skill kelly-criterion -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install agiprolabs/claude-trading-skills kelly-criterion --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/kelly-criterion .claude/skills/kelly-criterion && 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 "kelly-criterion" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/kelly-criterion into .claude/skills/kelly-criterion/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kelly-criterion", 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/kelly-criterionType 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 kelly-criterion -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install agiprolabs/claude-trading-skills kelly-criterion --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/kelly-criterion .agents/skills/kelly-criterion && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "kelly-criterion" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/kelly-criterion into .agents/skills/kelly-criterion/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kelly-criterion", 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 kelly-criterion -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install agiprolabs/claude-trading-skills kelly-criterion --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/kelly-criterion .cursor/skills/kelly-criterion && 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 "kelly-criterion" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/kelly-criterion into .cursor/skills/kelly-criterion/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kelly-criterion", 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/kelly-criterion--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 kelly-criterion -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install agiprolabs/claude-trading-skills kelly-criterion --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/kelly-criterion .gemini/skills/kelly-criterion && 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 "kelly-criterion" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/kelly-criterion into .gemini/skills/kelly-criterion/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kelly-criterion", 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 kelly-criterionInstalls 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 kelly-criterion -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/kelly-criterion .github/skills/kelly-criterion && 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 "kelly-criterion" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/kelly-criterion into .github/skills/kelly-criterion/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kelly-criterion", 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 kelly-criterion -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 kelly-criterion --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/kelly-criterion .opencode/skills/kelly-criterion && 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 "kelly-criterion" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/kelly-criterion into .opencode/skills/kelly-criterion/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kelly-criterion", 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.
kelly-criterionKelly criterion optimal sizing with fractional variants, edge estimation, and practical application for crypto trading
Kelly Criterion is an agent skill from agiprolabs/claude-trading-skills. Kelly criterion optimal sizing with fractional variants, edge estimation, and practical application for crypto trading
Its SKILL.md is about 2.7k 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/kelly_derivation.md`, `references/practical_kelly.md` and `scripts/kelly_calculator.py`).
It sits in Business, Finance & HR, covering Trading and backtesting. 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.
3 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.
Kelly Criterion loads about 2.7k tokens when it runs, and up to ~6.7k if it reads all its reference files. Until then it costs about 34 tokens; SKILL.md has 1,138 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). 1,138 words, ~2,737 tokens.
.claude/skills/kelly-criterion/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.The Kelly criterion is the mathematically optimal bet size that maximizes long-term geometric growth of capital. Developed by John Kelly at Bell Labs in 1956, it answers a precise question: given a known edge, what fraction of your bankroll should you risk to maximize the compounding rate?
Core insight: Betting too small leaves growth on the table. Betting too large increases ruin risk and actually reduces long-term growth. Kelly finds the exact optimum between these extremes.
Practical insight: You should almost never use full Kelly. Estimation error in your edge means full Kelly will overbets in practice. Use fractional Kelly (0.25x to 0.5x) for real trading.
For a binary outcome (win or lose):
f* = (p * b - q) / bWhere:
f* = optimal fraction of bankroll to betp = probability of winningq = probability of losing (1 - p)b = payoff ratio (average win / average loss)Equivalent forms:
f* = p - q / b
f* = p - (1 - p) / b
f* = (p * b - (1 - p)) / bEdge = p * b - q = expected value per unit risked. Kelly only makes sense when edge > 0. If edge is zero or negative, the optimal bet is zero — do not trade.
| Win Rate | Payoff 1:1 | Payoff 1.5:1 | Payoff 2:1 | Payoff 3:1 |
|---|---|---|---|---|
| 40% | -20% | -6.7% | 10% | 20% |
| 45% | -10% | 3.3% | 15% | 25% |
| 50% | 0% | 16.7% | 25% | 33.3% |
| 55% | 10% | 18.3% | 27.5% | 35% |
| 60% | 20% | 26.7% | 35% | 40% |
Values are full Kelly fraction. In practice, use 0.25x to 0.5x of these numbers.
Full Kelly assumes you know p and b exactly. You never do. Here is why fractional Kelly is essential:
Your win rate estimate from 100 trades has a standard error of roughly ±5%. If your true win rate is 55% but you estimate 60%, full Kelly will overbets by ~50%, which reduces long-term growth below what half Kelly would achieve.
Full Kelly has extremely high variance. Expected maximum drawdown for full Kelly is roughly 50-80% of account. This is psychologically devastating and practically dangerous (margin calls, inability to continue trading).
| Kelly Fraction | Relative Growth Rate | Approximate Max Drawdown |
|---|---|---|
| 1.0x (full) | 100% | 50-80% |
| 0.5x (half) | ~75% | 25-40% |
| 0.25x (quarter) | ~50% | 12-20% |
| 0.1x (tenth) | ~25% | 5-10% |
Overbetting by 2x (betting at 2f) produces zero long-term growth — the same as not trading at all. Underbetting by 2x (betting at 0.5f) still captures ~75% of the optimal growth rate. The penalty for overbetting is catastrophically worse than for underbetting.
| Fraction | When to Use |
|---|---|
| 0.10x Kelly | Very uncertain edge, new strategy, < 30 trades in sample |
| 0.25x Kelly | Moderate confidence, 30-100 trades, reasonable Sharpe |
| 0.50x Kelly | High confidence, 100+ trades, consistent performance |
| 1.00x Kelly | Never recommended in practice |
Kelly requires two inputs: win rate (p) and payoff ratio (b). Both must be estimated from data.
wins = [t for t in trades if t > 0]
losses = [t for t in trades if t < 0]
win_rate = len(wins) / len(trades) # p
payoff_ratio = mean(wins) / abs(mean(losses)) # b
edge = win_rate * payoff_ratio - (1 - win_rate) # should be > 0
kelly_full = (win_rate * payoff_ratio - (1 - win_rate)) / payoff_ratioUse the lower bound of a Wilson confidence interval for win rate rather than the point estimate:
import math
def wilson_lower(wins: int, total: int, z: float = 1.96) -> float:
"""Lower bound of Wilson score interval (95% confidence)."""
p = wins / total
denominator = 1 + z**2 / total
centre = p + z**2 / (2 * total)
spread = z * math.sqrt((p * (1 - p) + z**2 / (4 * total)) / total)
return (centre - spread) / denominatorUsing the lower bound of the confidence interval for win rate automatically builds in conservatism, reducing the risk of overbetting due to sampling luck.
| Edge Value | Classification | Notes |
|---|---|---|
| < 0 | Negative edge | Do not trade this strategy |
| 0 - 0.02 | No meaningful edge | Transaction costs likely exceed edge |
| 0.02 - 0.10 | Marginal edge | Conservative fractions only |
| 0.10 - 0.20 | Good edge | Standard fractions appropriate |
| > 0.20 | Excellent edge | Rare; verify not overfitting or temporary |
When holding multiple positions simultaneously:
If bets are uncorrelated, each can be sized at its individual Kelly fraction. However, the sum of all Kelly fractions should not exceed 1.0 (total portfolio). If it does, scale each proportionally:
kelly_fractions = [0.15, 0.10, 0.12, 0.08] # individual Kelly fractions
total = sum(kelly_fractions) # 0.45
if total > 1.0:
scale = 1.0 / total
kelly_fractions = [f * scale for f in kelly_fractions]Correlated positions (e.g., multiple SOL memecoins) are effectively one larger bet. Reduce each position proportionally to the correlation:
# Simple correlation adjustment
def adjust_for_correlation(kelly_fractions: list, avg_correlation: float) -> list:
"""Reduce Kelly fractions based on average inter-position correlation."""
n = len(kelly_fractions)
# Effective number of independent bets
n_eff = n / (1 + (n - 1) * avg_correlation)
scale = n_eff / n
return [f * scale for f in kelly_fractions]In crypto, meme token positions often have correlations of 0.5-0.8 with each other (they all dump together in risk-off). Treat them as partially one bet.
Regardless of individual calculations, enforce a hard cap: total Kelly allocation should never exceed 1.0 (100% of portfolio). A practical maximum is 0.6-0.8 to leave cash buffer for drawdowns and new opportunities.
Meme token trading presents specific challenges for Kelly:
def meme_kelly(win_rate: float, payoff_ratio: float, account: float) -> float:
"""Conservative Kelly for high-uncertainty meme token trades."""
kelly_full = (win_rate * payoff_ratio - (1 - win_rate)) / payoff_ratio
kelly_conservative = kelly_full * 0.15 # 0.15x fractional
max_fraction = 0.05 # hard cap at 5%
return min(max(kelly_conservative, 0), max_fraction) * accountKelly optimality relies on assumptions that are often violated:
| Assumption | Reality | Impact |
|---|---|---|
| Known edge (p, b) | Estimated from noisy data | Overbetting risk |
| Independent bets | Correlated positions | Ruin risk increases |
| Binary outcomes | Continuous P&L distribution | Formula approximation |
| Stationary edge | Edge changes over time | Stale sizing |
| No transaction costs | Slippage, fees, MEV | Effective edge lower |
| Unlimited divisibility | Minimum position sizes | Rounding needed |
references/kelly_derivation.md)When returns are continuous rather than binary win/lose:
f* = (μ - r) / σ²Where:
μ = expected return of the strategyr = risk-free rate (often 0 for crypto)σ² = variance of returnsThis is equivalent to Sharpe² / (2 * σ) when the Sharpe ratio is computed as (μ - r) / σ.
Use this form when you have a return stream rather than discrete win/loss trades. See references/kelly_derivation.md for the full derivation.
position-sizing: Kelly provides the optimal fraction; position-sizing translates that into units. Use Kelly as one input, then apply liquidity and volatility constraints from position-sizing.risk-management: Kelly sizing must respect portfolio-level risk limits. If Kelly suggests 10% per trade but your risk policy caps at 5%, the cap wins.strategy-framework: Document your Kelly parameters (fraction used, sample size, recalculation frequency) as part of strategy specification.regime-detection: Recalculate Kelly when regime changes. Edge in a trending market differs from edge in a ranging market.references/kelly_derivation.md — Full mathematical derivation of Kelly criterion, fractional Kelly growth rates, continuous Kelly, and multi-outcome Kellyreferences/practical_kelly.md — Edge estimation from trading data, confidence intervals, worked examples, common pitfalls, and danger zonesscripts/kelly_calculator.py — Kelly calculator from win rate, payoff ratio, and account size. Prints fractional Kelly recommendations and sensitivity analysis. Dependencies: none.scripts/kelly_from_trades.py — Estimate Kelly from a list of trade P&L values. Computes confidence intervals, rolling stability analysis, and recommended fraction. Dependencies: numpy.© 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/kelly-criterion of agiprolabs/claude-trading-skills.
Open the folder on GitHubat commit 981e1d7
Kelly Criterion 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 |
|---|---|---|---|---|---|---|
| Kelly Criterion this skillagiprolabs/claude-trading-skills | 410 | — | ~2.7k | Automated safety check: Pass | MIT | |
| Tushare Datazillionare/zillionare | 322 | 2 repos | ~2.3k | Automated safety check: Pass | None | |
| Tradingview MCPatilaahmettaner/tradingview-mcp | 5k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Digital Oraclekomako-workshop/digital-oracle | 878 | — | ~5.9k | Automated safety check: Pass | MIT | |
| Polyclawchainstacklabs/polyclaw | 359 | 1 repos | ~2k | Automated safety check: Pass | Apache-2.0 | |
| Markdownfacioquo/stock-indicators-dotnet | 1.2k | — | ~812 | Automated safety check: Pass | Apache-2.0 |
zillionare/zillionare
面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。
atilaahmettaner/tradingview-mcp
AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…
komako-workshop/digital-oracle
Answer prediction questions using market trading data, not opinions.
chainstacklabs/polyclaw
Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.
facioquo/stock-indicators-dotnet
Format and lint Markdown in this repository against GitHub Flavored Markdown and its markdownlint-cli2 configuration — headers, lists, code fences, callouts (VitePress containers on docs-site pages…
MobiusQuant/OpenMobius-skill
Provides multi-school trading Q&A, chart/OHLCV analysis, annotation, and fresh-market workflows covering ICT/SMC, ChanLun, Wyckoff, Price Action, Order Flow, VSA, and Elliott Wave.
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
Categories
Kelly criterion optimal sizing with fractional variants, edge estimation, and practical application for crypto trading. Kelly Criterion is an agent skill from agiprolabs/claude-trading-skills.
Kelly Criterion fits situations like: tasks that involve Trading and backtesting.
Run `npx skills add agiprolabs/claude-trading-skills --skill kelly-criterion -a claude-code`. Or copy the skill folder (skills/kelly-criterion in agiprolabs/claude-trading-skills) into .claude/skills/kelly-criterion in your project. Claude Code loads it when a task matches its description.
Run `npx skills add agiprolabs/claude-trading-skills --skill kelly-criterion -a codex`. Or copy the skill folder (skills/kelly-criterion in agiprolabs/claude-trading-skills) into .agents/skills/kelly-criterion 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 kelly-criterion -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kelly-criterion, .gemini/skills/kelly-criterion, .github/skills/kelly-criterion and .opencode/skills/kelly-criterion in your project.
Going by SKILL.md and its folder, Kelly Criterion 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.
Kelly Criterion 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.7k tokens (SKILL.md is roughly 11k 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 4k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Kelly Criterion: Tushare Data (zillionare/zillionare, 322 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars), Digital Oracle (komako-workshop/digital-oracle, 878 stars) and Polyclaw (chainstacklabs/polyclaw, 359 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.