Capital Reallocation Based On Live Performance logo

Capital Reallocation Based On Live Performance

Community
HimanshuJ16
capital-reallocation-based-on-live-performance

Use when capital must be re-weighted across active strategies from their trailing live trade statistics, using fractional Kelly bounded by per-strategy capacity ceilings. It sizes each strategy independently of the others.

Overview

PublisherHimanshuJ16
RepositoryAlgo-Trading-Skills
Skill namecapital-reallocation-based-on-live-performance
Stars
50
Forks
7
Bundled files
5
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by HimanshuJ16 on GitHub. Read the source before you install it.

Installation

Install the Capital Reallocation Based On Live Performance AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/capital-reallocation-based-on-live-performance
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HimanshuJ16/Algo-Trading-Skills.git /tmp/Algo-Trading-Skills
mkdir -p .claude/skills
cp -r /tmp/Algo-Trading-Skills/skills/capital-reallocation-based-on-live-performance .claude/skills/capital-reallocation-based-on-live-performance
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Capital Reallocation Based On Live Performance in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Capital Reallocation Based On Live Performance on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Capital Reallocation Based On Live Performance is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

When to Use

Use this skill when managing a multi-strategy fund or portfolio where capital is limited and needs to be distributed among competing algorithms. Instead of static, equal-weight allocations, the engine converts each strategy's trailing live trade statistics (win rate, average win, average loss) into a fractional Kelly exposure target, then resolves those targets against each strategy's capacity ceiling and the size of the fund.

The engine sizes each strategy from its own edge. It is a position-sizing rule, not a ranking rule: two strategies with identical edge get identical capital regardless of how many other strategies exist, and a portfolio with weak aggregate edge deliberately leaves capital in cash.

When NOT to Use

  • Strongly correlated strategies. The engine sizes each strategy independently and sums the results. The true multi-asset Kelly solution is $f^* = \Sigma^{-1}\mu$, which accounts for covariance. Summing independent Kelly fractions overstates safe gross exposure when strategies are positively correlated — two strategies running the same trade are one bet, not two. Use a lower kelly_fraction plus an external gross-exposure cap, and see cross-strategy-correlation-monitoring.
  • Thin trade samples. Kelly is exquisitely sensitive to estimation error in the win rate. A strategy with 20 live trades has a win-rate standard error near 10 percentage points, which swings the Kelly weight far more than the underlying edge does. Do not reallocate on a sample too small to distinguish edge from variance.
  • Non-binary payoff profiles. The implemented formula is the discrete binary-bet Kelly. Strategies whose returns are heavily skewed or fat-tailed (short options, carry trades with rare large losses) are poorly summarised by a single win rate and average win/loss pair.
  • As a risk control. This engine allocates capital; it does not enforce limits. Drawdown circuit breakers and kill switches must sit downstream and independently — see kill-switch-and-drawdown-circuit-breakers.

Prerequisites

  • Multiple independent trading strategies reporting closed-trade PnL.
  • A centralized fund/portfolio controller capable of adjusting per-strategy buying power.
  • A trailing trade sample per strategy large enough to estimate win rate, average win and average loss with meaningful precision.
  • A per-strategy capacity estimate (max_capacity) derived from liquidity, not from performance — see strategy-capacity-estimation-before-scaling-capital.

Workflow

  1. Aggregate trailing statistics: At the reallocation boundary (EOD or weekly), compute each strategy's win rate and average win/loss magnitudes over a fixed trailing trade window. Use closed trades only; including open positions marks a strategy on unrealised PnL that may reverse.
  2. Compute fractional Kelly targets: The engine computes $f^* = W - (1-W)/R$ per strategy, where $R$ is the reward/risk ratio, floors it at zero, and scales it by kelly_fraction. A strategy with no measurable edge targets zero capital rather than a small position.
  3. Resolve against constraints: The engine applies two ceilings per strategy — its capacity limit and its own fractional Kelly target — and one fund-level constraint: total targets never exceed total fund capital. If gross Kelly demand exceeds the fund, all targets scale down proportionally; the engine never levers.
  4. Read the cash reserve, don't fight it: If gross Kelly demand is below 1.0, the undeployed remainder is intentional. Do not redistribute it to fill the fund — forcing it into the remaining strategies bets them above their own Kelly optimum, which is precisely the over-betting the fractional multiplier exists to prevent.
  5. Enact deltas as risk-limit changes: delta_capital instructs the OMS to change a strategy's buying power. A negative delta means stop granting new risk and let existing positions exit naturally; it is not a liquidation order.

Full procedure: see references/workflows.md. Standards reference: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Normalising the Kelly fraction away: If you convert Kelly weights into portfolio weights by dividing each by their sum, the fractional multiplier cancels out algebraically and Quarter-Kelly allocates exactly as much as Full-Kelly. The safeguard silently stops existing while still appearing in the config. Verify it bites: halving kelly_fraction must halve deployed capital.
  • Chasing noise: Reallocating too frequently (intraday, or on tick-by-tick PnL) causes whipsawing — capital arrives at a strategy exactly as it peaks and mean-reverts.
  • Full Kelly recklessness: Full Kelly maximises long-run growth given known parameters; with estimated parameters it reliably produces severe drawdowns. Under the standard quadratic growth approximation, betting $c\times$ Kelly retains $2c - c^2$ of the optimal growth rate — Half-Kelly keeps ~75% of the growth for half the exposure, and growth turns negative beyond $2\times$ Kelly. The engine rejects kelly_fraction > 1.0.
  • Ignoring capacity: Allocating $100M to a micro-cap strategy because its Kelly weight is high, when it cannot absorb more than $5M without destroying its edge through market impact. Capacity must be an independent input, never inferred from returns.
  • Order-dependent allocation: If the capping pass mutates its running weight total while iterating the strategy set, the same inputs produce different allocations depending on dictionary order, and capital can be silently stranded while other strategies still have headroom. Allocation must be a pure function of the inputs.
  • Minimum allocation floors: A "no strategy drops below 5%" floor is incompatible with edge-based sizing — it forces capital into a strategy the model has just judged to have no edge. Use a cash reserve instead of a floor.
  • Treating an unbeaten strategy as infinite edge: A strategy with zero average loss has an undefined reward/risk ratio. That is an unestimable edge, not an unbounded one; the engine allocates zero and logs a warning.

Verification

  • Run python -m unittest discover -s skills/capital-reallocation-based-on-live-performance/scripts.
  • Confirm kelly_fraction governs exposure: run the same portfolio at 1.0, 0.5 and 0.25 and check deployed capital scales proportionally.
  • Confirm order independence: shuffle the strategy dict and check the allocation is unchanged.
  • Confirm no target exceeds min(max_capacity, fund × fractional Kelly), and that the sum of targets never exceeds total fund capital.
  • Simulate two strategies, one with steady wins and one on a losing streak, and verify capital re-weights toward the winner while remaining bounded by capacity.

Related Skills

  • multi-strategy-capital-allocation-limits
  • incremental-capital-deployment-for-new-strategies
  • strategy-capacity-estimation-before-scaling-capital
  • cross-strategy-correlation-monitoring
  • kill-switch-and-drawdown-circuit-breakers

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Capital Reallocation Based On Live Performance AI skill do?

Use when capital must be re-weighted across active strategies from their trailing live trade statistics, using fractional Kelly bounded by per-strategy capacity ceilings. It sizes each strategy independently of the others.

Why use Capital Reallocation Based On Live Performance on TypingMind?

Because you install it once and use it with any model. Capital Reallocation Based On Live Performance is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Capital Reallocation Based On Live Performance in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/capital-reallocation-based-on-live-performance. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Capital Reallocation Based On Live Performance?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Capital Reallocation Based On Live Performance?

As many as you like. As long as a model supports skills, you can use Capital Reallocation Based On Live Performance with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Capital Reallocation Based On Live Performance AI skill free?

Yes. It is published on GitHub by HimanshuJ16 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇