Logo vun Position Sizing

Position Sizing

Communautéit
nimadorostkar
position-sizing

Use when deciding how large a position to take. Covers fixed-fractional risk, volatility-based sizing, the Kelly criterion and why to fractionalize it, and portfolio concentration limits. Trigger on "how much should i put in this trade", "how many shares should i buy", "should i use kelly sizing". Do not use for account-level drawdown limits and pre-trade rules — see the risk-management skill.

Iwwersiicht

Editeurnimadorostkar
RepositoryClaude-Skills-collection
Skill-Nummposition-sizing
Stären
34
Forks
4
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum nimadorostkar op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Position Sizing an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/finance/position-sizing
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection.git /tmp/Claude-Skills-collection
mkdir -p .claude/skills
cp -r /tmp/Claude-Skills-collection/skills/finance/position-sizing .claude/skills/position-sizing
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Position Sizing an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Position Sizing automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Position Sizing net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Position Sizing

Purpose

Determine how much to risk on a single position, so that a losing streak is survivable and no single idea can end the account. Position sizing determines survival; entry selection determines returns. Survival comes first.

When to Use

  • Deciding how many shares or contracts to buy.
  • Setting a risk-per-trade policy.
  • Checking whether a position breaches concentration limits.
  • Reviewing why a drawdown was deeper than expected.

Capabilities

  • Fixed-fractional sizing from a stop distance.
  • Volatility-adjusted sizing using ATR.
  • Kelly criterion, and fractional Kelly in practice.
  • Concentration limits: per position, per sector, per correlated group.
  • Aggregate portfolio risk.

Inputs

  • Account equity.
  • Entry price and stop price (or an ATR and a multiplier).
  • Risk per trade, as a percentage of equity.
  • Existing exposure, including correlated positions.

Outputs

  • A share or contract count.
  • The dollar risk if the stop is hit, stated explicitly.
  • Whether the position breaches any limit.

Workflow

  1. Fix the risk per trade first — Typically 0.5% to 2% of equity. This is a policy decision made when calm, not a per-trade judgment made when excited.
  2. Determine the stop — At a level where the thesis is wrong, not at a level that produces a comfortable size. This is the discipline that everything else depends on.
  3. Size from the stop distance — Shares = (equity × risk%) / (entry − stop). A wider stop means a smaller position, not more risk.
  4. Check the concentration limits — Position size as a percentage of equity, sector exposure, and correlated exposure. A limit breached is a size reduced.
  5. Check the aggregate — Ten positions each risking 1% is 10% at risk if they are correlated and all stop out together. In a market-wide selloff, they will be.

Best Practices

  • Never widen a stop to justify a larger position. That inverts the entire logic: the stop defines the risk, and the size follows from it.
  • Correlated positions are one position. Five semiconductor names is one bet on semiconductors, and it should be sized as one.
  • Full Kelly is theoretically optimal and practically unusable: it produces enormous drawdowns, and it assumes you know your edge precisely. You do not. Half-Kelly or less is the practical range.
  • A 50% drawdown requires a 100% gain to recover. Sizing that permits deep drawdowns is not aggressive; it is arithmetically self-defeating.
  • Volatility-based sizing normalizes risk across instruments: a fixed dollar risk on a volatile stock and a quiet one produces very different position values, and that is correct.
  • Recalculate the size on the current equity, not on the starting equity. Sizing off a high-water mark after a drawdown compounds the damage.

Examples

Fixed-fractional sizing — the calculation that matters:

python
def position_size(
    equity: float,
    entry: float,
    stop: float,
    risk_pct: float = 0.01,
    max_position_pct: float = 0.20,
) -> PositionSize:
    if stop >= entry:
        raise ValueError("stop must be below entry for a long position")

    risk_dollars = equity * risk_pct
    risk_per_share = entry - stop
    shares = int(risk_dollars / risk_per_share)

    # The concentration limit binds independently of the risk limit. A very tight
    # stop can otherwise produce a position worth more than the account.
    max_shares_by_concentration = int((equity * max_position_pct) / entry)
    limited = shares > max_shares_by_concentration

    final = min(shares, max_shares_by_concentration)

    return PositionSize(
        shares=final,
        position_value=final * entry,
        dollar_risk=final * risk_per_share,
        pct_of_equity=(final * entry) / equity,
        limited_by_concentration=limited,
    )

# equity 100,000 | entry 50.00 | stop 47.50 | risk 1%
#   risk_dollars    = 1,000
#   risk_per_share  = 2.50
#   shares          = 400          -> position value 20,000 (20% of equity)
#   At the concentration cap exactly. A tighter stop of 49.50 would compute
#   2,000 shares ($100,000 — the whole account), and the cap correctly binds.

Kelly, and why it is fractionalized:

python
def kelly_fraction(win_rate: float, avg_win: float, avg_loss: float) -> float:
    """f* = p - q/b, where b is the win/loss ratio."""
    b = avg_win / abs(avg_loss)
    f = win_rate - (1 - win_rate) / b
    return max(0.0, f)

# A genuinely good strategy: 55% win rate, 1.5:1 payoff.
#   full Kelly     = 0.55 - 0.45/1.5 = 0.25  -> risk 25% of equity per trade
#
# Full Kelly on this strategy produces expected drawdowns exceeding 50% and
# assumes the 55% and the 1.5 are known exactly. They are estimates from a
# finite sample; if the true win rate is 50%, full Kelly is a losing bet.
#
#   half Kelly     = 12.5%   still aggressive
#   quarter Kelly  =  6.25%  the upper end of what most practitioners use
#
# Most professional risk budgets land between 0.5% and 2% — far below even
# quarter Kelly — because the edge estimate is uncertain and ruin is permanent.

Notes

  • Kelly maximizes the expected logarithmic growth rate given a known edge. The edge is never known; it is estimated from a sample, and the estimate is biased upward by the fact that you chose this strategy because it looked good. Fractionalize accordingly.
  • Correlation rises toward 1 in a crisis. A portfolio that appears diversified in normal conditions can be a single position at the worst moment. Size for the correlated case.
  • This is educational material about position-sizing methodology, not financial advice. Any real allocation decision depends on circumstances this skill cannot see.

Heefeg gestallte Froen

Wat mécht de KI-Skill Position Sizing?

Use when deciding how large a position to take. Covers fixed-fractional risk, volatility-based sizing, the Kelly criterion and why to fractionalize it, and portfolio concentration limits. Trigger on "how much should i put in this trade", "how many shares should i buy", "should i use kelly sizing". Do not use for account-level drawdown limits and pre-trade rules — see the risk-management skill.

Firwat Position Sizing op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Position Sizing besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Position Sizing an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/finance/position-sizing an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Position Sizing benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Position Sizing benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Position Sizing domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Position Sizing gratis?

Jo. De Skill gëtt vum nimadorostkar ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇