trailing-stops
Skill64 starsChanged 16 days agoMITView on GitHub
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.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Bhala-Srinivash/nse-trading-skillstheir own version, first seen Mar 5, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Bhala-Srinivash/nse-trading-skills★ 36same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- backtest-labSkill
- breakout-plannerSkill
- broker-integrationSkill
- event-calendarSkill
- exhaustion-reversalSkill
- fibonacci-tradingSkill
- fii-dii-flowsSkill
- fno-options-analysisSkill
- fundamental-screeningSkill
- india-market-analystSkill
- indian-market-structureSkill
- indian-tax-for-tradersSkill
- ipo-analysisSkill
- macro-regimeSkill
- market-breadthSkill
- market-pulseSkill
- market-regimeSkill
- market-valuationSkill
- momentum-scannerSkill
- multi-timeframe-analysisSkill
- options-strategiesSkill
- pair-tradingSkill
- portfolio-reviewSkill
- position-sizingSkill
- results-seasonSkill
- risk-reward-ratioSkill
- rsi-divergenceSkill
- sector-rotationSkill
- stock-screenerSkill
- stop-loss-strategiesSkill
- technical-analysisSkill
- thesis-trackerSkill
- trading-costsSkill
- trading-disciplineSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
Before results, Budget or RBI policy days, tighten to the 1.5 × ATR level or book partial profits.
- Very specific: line 58
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 …
- Distinctive: line 65
Don't overtighten: a trail closer than about 1 ATR gets hit by ordinary pullbacks.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Trailing Stops
Trail to protect open profit while giving the trend room. The stop only moves in the trade's favour.
Calculator
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 760It 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
- A ratchet: up only (longs), down only (shorts).
- Evaluate on daily closes; exit in the closing session or at the next open when breached.
- Don't overtighten: a trail closer than about 1 ATR gets hit by ordinary pullbacks.
- 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]Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

