kelly-criterion

v1.0.0

凯利公式仓位管理系统 — 用数学公式计算最优下注比例,实现长期资金最大化增长。当用户说「凯利公式」「仓位管理」「最优仓位」「凯利半仓」「Kelly Criterion」「破产风险」时激活。

0· 72·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for danpian1/kelly-criterion.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "kelly-criterion" (danpian1/kelly-criterion) from ClawHub.
Skill page: https://clawhub.ai/danpian1/kelly-criterion
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install kelly-criterion

ClawHub CLI

Package manager switcher

npx clawhub@latest install kelly-criterion
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk9715kt9vf78yh1x834rd9x8gd851k7s
72downloads
0stars
1versions
Updated 1w ago
v1.0.0
MIT-0

凯利公式仓位管理体系

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

公式详解

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

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

实例计算

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

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%
- 凯利建议 < 5% → 放弃或用最小单位
- 总仓位 > 80% → 不再加仓

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

参考

详见 references/kelly-calculator.md

Comments

Loading comments...