dsl-exit-engine

dsl-exit-engine is a skill for Claude Code from Superior-Trade/superior-skills. It costs 78 tokens per session (1,860 once invoked), scanned A, original, MIT.

A reusable specification for how a Freqtrade strategy exits trades. Freqtrade is a crypto-trading framework; this guide defines a profit-target ladder, a hard loss limit, and a trailing stop that tightens after profit reaches a threshold.

In plain words
What is it for?
Use it to design or tune ROI ladders, stop-losses, ratcheting trailing stops, two-phase exits, and other Freqtrade exit logic.
Why use it?
It avoids rewriting similar exit rules separately in every strategy. The phases distinguish taking profits, limiting losses, and protecting gains as a trade improves.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the superior-skills plugin — 31 skills shipped together

Good fit Use it to design or tune ROI ladders, stop-losses, ratcheting trailing stops, two-phase exits, and other Freqtrade exit logic.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/superior-trade/superior-skills/dsl-exit-engine
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 Superior-Trade/superior-skills --skill dsl-exit-engine
Clone the repo
git clone --depth 1 https://github.com/Superior-Trade/superior-skills

Made for: Claude Code.

Or install superior-skills, the plugin that ships this one along with the rest of its 31 skills.

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 dsl-exit-engine

README.md
[![agentmods](https://agentmods.dev/badge/skills/superior-trade/superior-skills/dsl-exit-engine/github.svg)](https://agentmods.dev/skills/superior-trade/superior-skills/dsl-exit-engine)
Your own site
<a href="https://agentmods.dev/skills/superior-trade/superior-skills/dsl-exit-engine"><img src="https://agentmods.dev/badge/skills/superior-trade/superior-skills/dsl-exit-engine/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 dsl-exit-engine

Your own site · 80×15
<a href="https://agentmods.dev/skills/superior-trade/superior-skills/dsl-exit-engine"><img src="https://agentmods.dev/badge/skills/superior-trade/superior-skills/dsl-exit-engine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,860 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.00078 $0.01860
Opus 5 $0.00039 $0.00930
Sonnet 5 $0.00016 $0.00372
Haiku 4.5 $0.00008 $0.00186

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

Security

Grade A, and why

dsl-exit-engine 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 13d 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.

skills/dsl-exit-engine/SKILL.md · 130 lines

How it starts

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

DSL Exit Engine — Three-Phase Exit Primitive

A reusable exit primitive that any strategy skill can compose. Replaces the ad-hoc trailing-stop logic currently duplicated inside breakout with a single, declarative spec.

Other names this is searchable under: ratcheting trailing stop, two-phase exit, ALO-aware exit, dynamic stoploss DSL, ROI ladder.


Why a DSL

The Freqtrade IStrategy lifecycle gives you stoploss, trailing_stop, trailing_stop_positive, minimal_roi, and custom_exit. Each strategy ends up reimplementing the same three-phase shape:

  1. Phase 0 — Take-profit ladder (minimal_roi). Cash out winners at known target tiers, decaying over time. For mean-reversion / scalper strategies, this is the primary profit mechanism.
  2. Phase 1 — Survival (stoploss). A hard max-loss cutoff while the trade is underwater or barely above breakeven.
  3. Phase 2 — Ratchet (trailing_stop). Once unrealized PnL clears an activation threshold, switch to a trailing stop that only tightens, never loosens. For trend-follow strategies, this is the primary profit mechanism.

This file specifies all three. Strategies declare the parameters and inherit the behavior.

Validated evidence

Across 21 backtests on the Nov 2025 → May 2026 window, the trailing_stop_loss exit-reason bucket was positive in every single backtest where Phase 2 activated:

Strategy Trailing-stop bucket PnL Strategy total PnL
Funding-fader minimal BTC +$108 -$8
Funding-fader v3 BTC +$75 -$11
Striker v1 multipair +$373 -$112
Striker v2 multipair +$170 -$26
Donchian 4h BTC baseline +$78 +$13
Donchian 4h quick-exit BTC +$36 +$19
Donchian strong-regime BTC +$10 +$10

The Phase 2 ratchet is the most consistently profitable primitive in the entire toolkit. The strategies that lost did so via Phase 1 stops or signal exits, not because the trailing stop misfired.

Inverse finding for minimal_roi: the standard template minimal_roi = {"0": 100.0} (used in most repo strategies) effectively disables Phase 0. For mean-reversion and scalp strategies this leaves money on the table — wins that should have been taken at +2.5% kept giving back. The bollinger-reverter-4h strategy's edge depends entirely on its minimal_roi ladder.

Read the full file on GitHub · 130 lines

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. 13d ago First seen · 130 lines · 78 tokens per session scan A d4c518e16991

Subscribe to this mod's changes

dsl-exit-engine is a skill published in the GitHub repository Superior-Trade/superior-skills (209 stars, last pushed 2d ago), licensed MIT. It adds 78 tokens to every session and 1,860 once invoked, about $0.0004 per session on Opus 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.