ib-trailing-stop

ib-trailing-stop is a skill for Claude Code from staskh/trading_skills. It costs 49 tokens per session (1,712 once invoked), scanned A, original, MIT.

A manager for native trailing-stop orders in Interactive Brokers. A trailing stop is an order whose trigger follows a rising market price and stays in place when the price falls.

In plain words
What is it for?
Use it to set trailing stops on stocks and uncovered LEAPS positions in IB. It excludes PMCC positions, which are diagonal call spreads.
Why use it?
It helps protect gains or limit losses without manually changing the stop as the price moves. It starts in dry-run mode, so it does not place orders unless execution is requested.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; positional $N argument.

Good fit Use it to set trailing stops on stocks and uncovered LEAPS positions in IB. It excludes PMCC positions, which are diagonal call spreads.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/staskh/trading_skills/ib-trailing-stop
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.

Any agent
npx skills add staskh/trading_skills --skill ib-trailing-stop
Clone the repo
git clone --depth 1 https://github.com/staskh/trading_skills

Made for: Claude Code.

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 ib-trailing-stop

README.md
[![agentmods](https://agentmods.dev/badge/skills/staskh/trading_skills/ib-trailing-stop/github.svg)](https://agentmods.dev/skills/staskh/trading_skills/ib-trailing-stop)
Your own site
<a href="https://agentmods.dev/skills/staskh/trading_skills/ib-trailing-stop"><img src="https://agentmods.dev/badge/skills/staskh/trading_skills/ib-trailing-stop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ib-trailing-stop

Your own site · 80×15
<a href="https://agentmods.dev/skills/staskh/trading_skills/ib-trailing-stop"><img src="https://agentmods.dev/badge/skills/staskh/trading_skills/ib-trailing-stop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,712 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00049 $0.01712
Opus 5.5 $0.00020 $0.00685
Sonnet 5.5 $0.00010 $0.00342
Haiku 4.5 $0.00005 $0.00171

Measured 1mo ago against content hash b461cb72d35b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ib-trailing-stop 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/trailing_stop.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.claude/skills/ib-trailing-stop/SKILL.md · 163 lines

How it starts

The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.

IB Trailing Stop Manager

Places IB native TRAIL orders against stocks and naked LEAPS in the portfolio. IB auto-adjusts the stop trigger as the price climbs and locks it as price falls.

PMCC positions are intentionally excluded — use ib-stop-loss for those (a standalone trailing stop on the PMCC long leg would break the hedge at trigger).

Default mode is dry-run — no orders are placed unless --execute is in the request.

IB Connection

TWS or IB Gateway must be running locally with API enabled:

  • Paper trading — port 7497
  • Live trading — port 7496
  • IB_PORT env var — default port when --port is omitted (e.g. IB_PORT=4001 for a Gateway container). Precedence: --port flag > IB_PORT > built-in default. Set it in the shell or a .env file.

Port fallback: If the configured port fails, automatically retry on the other port. If the retry succeeds, save to memory which account type worked (live/paper) and reuse it for all IB skill calls in this and future sessions — until the user explicitly asks for the other account. If both ports fail, ask the user to verify that TWS or IB Gateway is running with API access enabled.

Instructions

Step 1: Run the script

Dry-run (default — no orders placed):

uv run python .claude/skills/ib-trailing-stop/scripts/trailing_stop.py --symbols JOBY --trail-pct 20

Execute (cancel orphan TS_ orders + place new TS_ TRAIL orders):

uv run python .claude/skills/ib-trailing-stop/scripts/trailing_stop.py --symbols JOBY --trail-pct 20 --execute

Execute forced (cancel + replace existing TS_ orders with current parameters):

uv run python .claude/skills/ib-trailing-stop/scripts/trailing_stop.py --execute --forced

Step 2: Format the report

Format JSON output as a markdown report with three sections:

Section 1: Existing TRAIL Orders

Show all_trail_orders.module (TS_ orders) and all_trail_orders.manual (manually placed). If orphan_orders is non-empty, warn that these were cancelled (execute mode) or need manual cancellation (dry-run).

Read the full file on GitHub · 163 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 163 lines · 49 tokens per session scan A b461cb72d35b

Subscribe to this mod's changes

ib-trailing-stop is a skill published in the GitHub repository staskh/trading_skills (389 stars, last pushed 3d ago), licensed MIT. It adds 49 tokens to every session and 1,712 once invoked, about $0.0002 per session on Opus 5.5. 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-30.

Related

Other skills, from other repositories

clawby-data

Query and analyze real financial data for any asset (US stocks / options / crypto / forex / perps / prediction markets) — quotes, volume, short volume & short interest, borrow fee, dark pool, options chain, Reddit sentiment, OHLC bars, FTDs, dividends & splits, stock screener, company financials & SEC filings (income…

openclawby/openclawby-skills · 204 tokens

find-cpa-firm

Use whenever the user wants to find, shortlist, vet, or enrich US accounting and tax firms (CPA firms) — financial-statement audit, SOC 1/2 audit, corporate tax, bookkeeping for businesses, advisory/fractional CFO, M&A diligence, 409A valuations, R&D tax credits, IPO readiness, sales-and-use tax. Triggers on "find me…

nostrband/ServiceGraph · 238 tokens

obai-strategy

Quantitative equity strategy design and backtesting via the OBaI backtest MCP server (http://localhost:8007/mcp). Use when the user wants to build, test, backtest, optimize, refine, repair, or compare a trading strategy, run walk-forward robustness validation, inspect trade logs, or follow up on a backtest job.…

sixteen-dev/obai · 121 tokens

nse-trading-toolkit

Master orchestrator for Indian NSE/BSE equity trading analysis via Groww broker. Routes to specialized framework skills: technical analysis, position sizing, stop-loss, trailing stops, risk-reward, multi-timeframe, RSI divergence, and Fibonacci trading. Use this skill whenever the user asks to: analyze a stock, check…

Bhala-Srinivash/nse-trading-skills · 165 tokens

fibonacci-trading

Fibonacci retracement and extension trading for NSE/BSE equities. Covers entry zones using retracement levels, profit targets using extension levels, and confluence zone identification. Use when the user asks: "fib levels for [stock]", "Fibonacci retracement", "fib extensions", "where to enter on pullback", "what are…

Bhala-Srinivash/nse-trading-skills · 101 tokens

multi-timeframe-analysis

Multi-timeframe analysis using the 3-screen method for NSE/BSE equities. Higher timeframe sets bias, primary timeframe identifies setup, lower timeframe times the entry. Includes confluence scoring system. Use when the user asks: "what's the weekly trend", "daily vs weekly", "multi-timeframe check", "higher timeframe…

Bhala-Srinivash/nse-trading-skills · 105 tokens