← Back to Skills Marketplace
danpian1

kelly-criterion

by danpian1 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
78
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install kelly-criterion
Description
凯利公式仓位管理系统 — 用数学公式计算最优下注比例,实现长期资金最大化增长。当用户说「凯利公式」「仓位管理」「最优仓位」「凯利半仓」「Kelly Criterion」「破产风险」时激活。
README (SKILL.md)

凯利公式仓位管理体系

核心公式:f = (bp - q) / b = (胜率 × 赔率 - 败率) / 赔率

公式详解

f = 每次投入的资金比例(0~1)
b = 赔率 = 潜在盈利 / 潜在亏损
p = 胜率(0~1)
q = 败率 = 1 - p

简化版:
f = (胜率 × 赔率 - 败率) / 赔率

实例计算

场景 p(胜率) b(赔率) f(仓位) 操作
高确定性 60% 1:1 20% 标准仓
强机会 55% 2:1 30% 积极
弱机会 50% 2:1 0%(不划算) 放弃
极高机会 70% 3:1 56% 重仓
A股T+0止损 40% 3:1 20% 轻仓

A股实战用法

参数估算方法

# 胜率估算:基于历史回测或主观判断
# 赔率估算:止盈价 / 止损价

# 实例:某股现价20元
# 目标止盈:22元(涨10%)
# 止损:19元(跌5%)
# 赔率b = 10% / 5% = 2
# 假设历史胜率55%

f = (0.55 × 2 - 0.45) / 2
f = (1.1 - 0.45) / 2
f = 0.325 → 32.5%

凯利变体(保守版)

版本 公式 适用场景
完整版 f = (bp-q)/b 精确数据
半凯利 f/2 普通投资者
四分之一凯利 f/4 极度保守

凯利仓位的最大优势

  • 不破产:长期使用不会归零
  • 最大化复利:资金增长速度最快
  • 动态调整:每次交易后重新计算

与A股仓位规则结合

凯利仓位上限:
- 单票凯利建议 > 40% → 限制在40%
- 凯利建议 \x3C 5% → 放弃或用最小单位
- 总仓位 > 80% → 不再加仓

止损前置:
- 凯利仓位已含止损
- 任何单笔亏损不超过总资金×凯利比例×止损%

参考

详见 references/kelly-calculator.md

Usage Guidance
This skill is internally coherent and appears to only provide calculations and guidance for the Kelly Criterion. Before installing, consider: (1) provenance — the skill has no homepage or source URL, so you can't verify the author; (2) this is advisory only — it won't fetch market data or place trades unless you later give a separate skill or connector permission and credentials to do so; (3) Kelly's outputs depend entirely on your estimates of win rate and payoff — misestimates can cause large losses, so treat outputs as illustrative and test with sample numbers; (4) never provide trading account credentials to a skill unless you explicitly trust and verify the integration. If you need automated trading, expect additional permissions (APIs/keys) and review those carefully.
Capability Analysis
Type: OpenClaw Skill Name: kelly-criterion Version: 1.0.0 The skill bundle provides educational content and instructions for calculating investment position sizes using the Kelly Criterion. It contains no executable code, network requests, or suspicious instructions, and its content is entirely consistent with its stated purpose of financial position management (SKILL.md, references/kelly-calculator.md).
Capability Assessment
Purpose & Capability
The name/description (Kelly criterion, position sizing) matches the SKILL.md content: formulas, worked examples, A-share usage notes and conservative variants. There are no unrelated required binaries, environment variables, or config paths that would be disproportionate to a calculation/ advisory skill. (Note: source/homepage not provided, which reduces provenance but doesn't make the functionality incoherent.)
Instruction Scope
SKILL.md contains only formulas, parameter-estimation guidance, examples, caps/limits and a short reference file. It does not instruct the agent to read system files, access environment variables, call external endpoints, or transmit data elsewhere. The scope is limited to calculating and explaining Kelly-based position sizing.
Install Mechanism
No install spec and no code files — instruction-only. Nothing is downloaded or written to disk, so there is no install-time execution risk.
Credentials
The skill does not request any environment variables, credentials, or config paths. This is proportional to a purely computational/advisory skill.
Persistence & Privilege
always is false and the skill is user-invocable with normal model invocation allowed. That is expected for a conversational/calculation skill and does not by itself increase privilege beyond normal operation.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install kelly-criterion
  3. After installation, invoke the skill by name or use /kelly-criterion
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the kelly-criterion skill. - Calculates optimal bet size using the Kelly formula to maximize long-term capital growth. - Activates when users mention "凯利公式", "仓位管理", "最优仓位", "凯利半仓", "Kelly Criterion", or "破产风险". - Includes formula breakdown, example scenarios, parameter estimation guidance, practical A-share use cases, and conservative Kelly variants. - Provides guidelines for position sizing and risk management based on Kelly outputs.
Metadata
Slug kelly-criterion
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is kelly-criterion?

凯利公式仓位管理系统 — 用数学公式计算最优下注比例,实现长期资金最大化增长。当用户说「凯利公式」「仓位管理」「最优仓位」「凯利半仓」「Kelly Criterion」「破产风险」时激活。 It is an AI Agent Skill for Claude Code / OpenClaw, with 78 downloads so far.

How do I install kelly-criterion?

Run "/install kelly-criterion" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is kelly-criterion free?

Yes, kelly-criterion is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does kelly-criterion support?

kelly-criterion is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created kelly-criterion?

It is built and maintained by danpian1 (@danpian1); the current version is v1.0.0.

💬 Comments