Skip to main content
skill CX Codex

trailing-stops — Claude Code skill: what it does, how to install

A Claude Code skill for calculating trailing stops on NSE/BSE positions. It activates when a trade moves into profit and the stop needs an update.

MIT ★ 69 updated 2026-11-13

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add Shubhamkumartrichy/claude-trading-skills-india
/plugin install india-trading-skills@india-trading-skills
Open on GitHub

What trailing-stops does

The skill calculates stop levels and recommends a ratcheted stop that never moves below the current one. Its default ladder holds the initial stop below 1R, moves it to breakeven at 1R, uses an ATR trail from 2R, then follows price structure from 3R. Other methods cover moving averages and the Chandelier exit.

Run risk.py trail to get the R gain, ladder stage, candidate levels and recommended stop. The calculation needs Python 3 and position inputs; ta.py summary provides ATR, SMA20 or EMA50 and the latest swing low. For Indian brokers, the instructions cover daily updates after the close, GTT changes for delivery holdings and re-entering SL orders that expire each day. GTT and SL execution details are specific to the Indian market.

What it helps with

  • calculate a stop level from R gain and ATR
  • move a stop to breakeven at 1R
  • compare ATR and structure-based trailing methods
  • update a GTT or replace an expiring SL order

Example prompts for the agent

  • Calculate a trailing stop for my NSE position: entry 750, stop 720, highest close 845.
  • At what point should this trade's stop move to breakeven?
  • Compare an ATR trail with a structure trail for my BSE position.

How to install trailing-stops

1Plugin marketplace

/plugin marketplace add Shubhamkumartrichy/claude-trading-skills-india
/plugin install india-trading-skills@india-trading-skills

This installs the whole india-trading-skills plugin with all its skills

2Skills CLI (Vercel)

npx skills add Shubhamkumartrichy/claude-trading-skills-india --skill trailing-stops -a claude-code

3Manually: put the files in place

~/.claude/skills/trailing-stops/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/trailing-stops/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about trailing-stops

How do I install trailing-stops in Claude Code?

Add the marketplace with /plugin marketplace add Shubhamkumartrichy/claude-trading-skills-india, then install the skill with /plugin install india-trading-skills@india-trading-skills.

What does trailing-stops do?

It calculates trailing-stop levels for NSE/BSE positions. Its methods include an R-multiple ladder, ATR and structure trails, moving averages, and the Chandelier exit.

What does trailing-stops need to run?

The risk.py trail calculation requires Python 3 and position inputs. Use ta.py summary for ATR, SMA20 or EMA50 and the latest swing low.

Source text

SKILL.md · MIT
---
name: trailing-stops
description: |
  Trailing-stop plans that lock in profit on NSE/BSE positions: the R-multiple ladder (hold → breakeven
  at 1R → ATR trail at 2R → structure trail at 3R+), plus ATR, structure, moving-average and
  chandelier trails, with GTT/SL execution realities for Indian brokers. risk.py trail computes
  the recommended ratcheted stop.

  Use when the user asks: "how should I trail my stop", "lock in profits on X", "when to move stop to
  breakeven", "chandelier exit", "protect my gains", "my stock is up 15%, what now", or anything about
  adjusting stops as a trade moves in their favour.
---

# Trailing Stops

Trail to protect open profit while giving the trend room. The stop only moves in the trade's favour.

## Calculator

```bash
python3 ../position-sizing/scripts/risk.py trail --entry 750 --stop 720 --highest-close 845 \
    --atr 14 --swing-low 805 --highest-high 850 --sma20 812 --current-stop 760
```
It reports R gained, the ladder stage, every candidate level, and the recommended stop (never below
`--current-stop`). Get ATR, SMA20/EMA50 and the latest swing low from `ta.py summary`.

## The R-multiple ladder (default)

1R = entry − initial stop.

| Stage | Open profit | Stop rule | Why |
|---|---|---|---|
| Fresh | 0 – 1R | Keep the initial stop | Trailing early gets shaken out by noise |
| Early | ≥ 1R | Move to breakeven (entry; add costs for true breakeven) | The trade can no longer lose money |
| Building | ≥ 2R | Highest close − 1.5 × ATR(14) | Gives room while banking most of the move |
| Runner | ≥ 3R | Below the latest higher low (structure) | Follows the trend's own rhythm |

Take the **highest** qualifying level (the tightest) and never lower it.

## Individual methods

| Method | Rule | Best for |
|---|---|---|
| ATR trail | Highest close − k × ATR (k 1.5 tight / 2 standard / 3 loose) | Trending but volatile stocks |
| Structure | Below each new higher low | Clean stair-step trends |
| MA trail | Daily close below SMA20 (fast) / EMA50 (steady) / SMA200 (positional) → exit | Smooth grinders |
| Chandelier | Highest high − 3 × ATR | Explosive runners, momentum names |
| Partial + trail | Book 30–50% at 2R or the 127.2% Fib, trail the rest | Results-season or event-heavy names |

## Execution in India

- **Update daily after the close** using the official close (30-min VWAP), not intraday wicks.
  Modify the **GTT** for delivery holdings, or re-place the SL each morning because SL orders expire daily.
- For F&O positions, trail on the underlying or futures chart and execute with SL-limit orders.
  Brokers' old bracket/cover orders with trailing are largely discontinued.
- Before **results, Budget or RBI policy days**, tighten to the 1.5 × ATR level or book partial
  profits. A gap can jump past any trail.
- **Tax-aware trailing:** if a delivery position is a few weeks from turning long-term (over 12
  months), a slightly looser trail may be worth it because the tax rate drops from 20% to 12.5%.
  Quantify it with `indian-tax-for-traders`.

## Rules
1. A ratchet: up only (longs), down only (shorts).
2. Evaluate on daily closes; exit in the closing session or at the next open when breached.
3. Don't overtighten: a trail closer than about 1 ATR gets hit by ordinary pullbacks.
4. Choose the method before the trade and stick to it.

## Output

```
Gained: x.xR → stage: [..]
Candidates: breakeven ₹.. | ATR(1.5x) ₹.. | structure ₹.. | chandelier ₹.. | SMA20 ₹..
New stop: ₹S (locks +y.yR) → update GTT trigger ₹S / limit ₹S−b
Next review: after today's close; event risk: [results on dd-mmm]
```

© Shubham Kumar · MIT · Shubhamkumartrichy/claude-trading-skills-india

Similar skills

All skills for Finance and business →

From the same set36

The whole set →
india-trading-skills The india-trading-skills Claude Code plugin analyzes NSE and BSE equities, F&O, trading costs, and Indian taxes. Ask about a stock, options setup, or portfolio to get calculations and market analysis. ★ 69repo stars risk-reward-ratio The risk-reward-ratio Claude Code skill evaluates trade risk and potential returns after costs. It calculates R multiples, breakeven win rate, and expectancy for entries, stops, and targets. CX Codex +1 ★ 69repo stars rsi-divergence The rsi-divergence Claude Code skill detects RSI(14) divergences on NSE/BSE stocks and indices. It activates for questions about bullish or bearish divergence and whether momentum confirms a new high or low. CX Codex +1 ★ 69repo stars fibonacci-trading The fibonacci-trading Claude Code skill calculates Fibonacci retracement zones and extension targets for NSE/BSE stocks and indices. It activates for pullback-entry questions or requests to calculate levels from a swing high and low. CX Codex +1 ★ 69repo stars multi-timeframe-analysis The multi-timeframe-analysis Claude Code skill reads a stock or index across multiple timeframes. It compares the higher-timeframe bias with a daily setup and entry timing on shorter bars. CX Codex +1 ★ 69repo stars stop-loss-strategies The stop-loss-strategies Claude Code skill helps set initial stops for Indian equities and F&O trades. It covers chart levels, position risk, and order execution. CX Codex +1 ★ 69repo stars fundamental-screening The fundamental-screening Claude Code skill screens Indian listed companies for fundamentals and governance risks. It runs on requests to assess a company, review quarterly results, or compare stocks. CX Codex +1 ★ 69repo stars ipo-analysis The ipo-analysis Claude Code skill evaluates Indian mainboard and SME IPOs. It activates for questions about applying, subscription figures, allotment chances, or listing dates. CX Codex +1 ★ 69repo stars

Project sponsors

Companies that keep this analytics open