position-size

position-size is a skill for Claude Code, Codex from AlgoChains/algochains-mcp-server. It costs 0 tokens per session (478 once invoked), scanned A, original, MIT.

A pre-trade calculator that suggests how many futures contracts to open based on the entry price, stop-loss price, capital, volatility, and related open positions. A stop-loss is a planned exit used to limit a losing trade.

In plain words
What is it for?
Use it before trading instruments such as MNQ to compare risk-based and volatility-based sizes, then account for reductions when positions are correlated.
Why use it?
It helps turn a chosen risk limit into a contract count and uses the more conservative result from two sizing methods.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/algochains/algochains-mcp-server/position-size
Any agent
npx skills add AlgoChains/algochains-mcp-server --skill position-size
Clone the repo
git clone --depth 1 https://github.com/AlgoChains/algochains-mcp-server

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for position-size

README.md
[![agentmods](https://agentmods.dev/badge/skills/algochains/algochains-mcp-server/position-size.svg)](https://agentmods.dev/skills/algochains/algochains-mcp-server/position-size)
Your own site
<a href="https://agentmods.dev/skills/algochains/algochains-mcp-server/position-size"><img src="https://agentmods.dev/badge/skills/algochains/algochains-mcp-server/position-size.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 478 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00478
Opus 5 $0.00000 $0.00239
Sonnet 5 $0.00000 $0.00096
Haiku 4.5 $0.00000 $0.00048

Measured 5d ago against content hash cb11ed56de6e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

position-size scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

algoclaw/skills/position-size/SKILL.md · 54 lines

What it actually says

position-size

Tier: 0 (safe, no live money)
Trigger: Pre-trade, on-demand
MCP Tool: run_algoclaw_skill("position-size", {"symbol":"MNQ","entry":18050,"stop":17990,"capital":50000})

What It Does

Computes optimal position size using multiple methods, returns the conservative minimum.

  1. R-Multiple (Van Tharp): (capital × risk_pct) / (entry - stop) per tick × tick_value
  2. Volatility-Targeted (Carver/pysystemtrade): (target_vol × capital) / (realized_vol × notional_per_contract)
  3. Conservative dual: min(R-multiple, vol-targeted)
  4. IDM check: if symbol is correlated with another active position, apply IDM reduction

Steps

  1. Call compute_r_multiple_size(symbol, entry, stop, capital, risk_pct=1.0)
  2. Call compute_volatility_targeted_size(symbol, current_price, annualized_vol_pct, capital)
  3. Call compute_idm(instruments=[symbol, ...active_positions...]) if >1 active instrument
  4. Return conservative minimum with explanation

Output Format

{
  "symbol": "MNQ",
  "entry": 18050,
  "stop": 17990,
  "capital": 50000,
  "methods": {
    "r_multiple": {
      "contracts": 2,
      "r_points": 60,
      "r_dollars": 120,
      "risk_dollars": 500,
      "risk_pct": 1.0
    },
    "vol_targeted": {
      "contracts": 2,
      "target_vol_pct": 20,
      "realized_vol_pct": 18.5
    }
  },
  "idm": {
    "applied": false,
    "reason": "MNQ is only active instrument"
  },
  "recommended": 2,
  "method_used": "r_multiple (both methods agree)",
  "r_multiple_targets": {"1R": 500, "2R": 1000, "3R": 1500}
}
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 54 lines · 0 tokens per session scan A cb11ed56de6e

Subscribe to this mod's changes

position-size is a skill published in the GitHub repository AlgoChains/algochains-mcp-server (1 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 478 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.