Agent skill

Dsl Exit Engine

by Superior-Trade in Superior-Trade/superior-skills

A skill your agent uses when designing or tuning exit logic for a Freqtrade strategy — ratcheting trailing stop, two-phase exit, ALO-aware exit, dynamic stoploss DSL, ROI ladder, take-profit ladder…

MITAuto-check passedBusiness, Finance & HR

Install Dsl Exit Engine

skills CLI
$ npx skills add Superior-Trade/superior-skills --skill dsl-exit-engine -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Superior-Trade/superior-skills dsl-exit-engine --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Superior-Trade/superior-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dsl-exit-engine .claude/skills/dsl-exit-engine && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dsl-exit-engine
GitHub stars
214
Token cost
~1.7k tokens
SKILL.md length
652 words
Files
1
Skills in repo
31
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when designing or tuning exit logic for a Freqtrade strategy — ratcheting trailing stop, two-phase exit, ALO-aware exit, dynamic stoploss DSL, ROI ladder, take-profit ladder…

  • Works in 3 steps: Phase 0 — Take-profit ladder… → Phase 1 — Survival (stoploss). A hard… → Phase 2 — Ratchet (trailing_stop). Once…
  • Tuning exit logic for a Freqtrade strategy — ratcheting trailing stop
  • SKILL.md covers Why a DSL, Validated evidence, Spec and Reference implementation (drop…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Dsl Exit Engine is an agent skill from Superior-Trade/superior-skills. Use when designing or tuning exit logic for a Freqtrade strategy — ratcheting trailing stop, two-phase exit, ALO-aware exit, dynamic stoploss DSL, ROI ladder, take-profit ladder, exit engine. Defines a three-phase exit that strategies compose: Phase 0 ROI ladder, Phase 1 hard stop, Phase 2 ratcheting trail.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Business, Finance & HR, covering Trading and backtesting. The repository describes itself as: Open agent skills and tool schemas for Superior Trade — build, backtest, and deploy trading strategies on Hyperliquid. The licence is MIT.

When your agent uses it

  • Tuning exit logic for a Freqtrade strategy — ratcheting trailing stop
  • Dynamic stoploss DSL
  • Take-profit ladder

Example prompts

  • “/dsl-exit-engine”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Phase 0 — Take-profit ladder (minimal_roi). Cash out winners at known target tiers, decaying over time. For mean-reversion / scalper…
  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…

What it can do on your machine

Read from SKILL.md and the folder at commit 9d41db5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml, python and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dsl Exit Engine loads about 1.7k tokens when it runs. Until then it costs about 81 tokens; SKILL.md has 652 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Superior-Trade/superior-skills at commit 9d41db5, republished under its MIT licence (© Superior-Trade). 652 words, ~1,729 tokens.

Download SKILL.mdSave it as .claude/skills/dsl-exit-engine/SKILL.md (or your agent's skills folder).
name
dsl-exit-engine
description
Use when designing or tuning exit logic for a Freqtrade strategy — ratcheting trailing stop, two-phase exit, ALO-aware exit, dynamic stoploss DSL, ROI ladder, take-profit ladder, exit engine. Defines a three-phase exit that strategies compose: Phase 0 ROI ladder, Phase 1 hard stop, Phase 2 ratcheting trail.
metadata.version
0.1.0
metadata.updated
2026-05-18

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:

StrategyTrailing-stop bucket PnLStrategy 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.

Spec

yaml
exit_engine:
  phase_0:
    roi_ladder:
      "0":    0.025   # take 2.5% immediately
      "60":   0.012   # 1.2% after 60 minutes
      "180":  0.005   # 0.5% after 3 hours
      "360":  0.0     # breakeven after 6 hours
  phase_1:
    max_loss_pct: 0.05        # hard stoploss while underwater (Freqtrade `stoploss`)
  phase_2:
    activate_at_pct: 0.025    # unrealized PnL that flips to trailing
    trail_offset_pct: 0.015   # distance from peak; ratchet only tightens
    min_step_pct: 0.002       # ignore noise below this when ratcheting
  exit_pricing:
    mode: "maker_then_taker"  # ALO post; if unfilled within timeout, fall through to taker
    maker_timeout_sec: 30
Phase 0 vs Phase 2 — when to use which

Use Phase 0 (minimal_roi ladder), skip Phase 2: mean-reversion, scalp, range strategies. Target moves are small (sub-3%), the trailing stop's +2-3% activation threshold rarely fires, and trailing stops give back too much when they do.

Use Phase 2 (trailing), skip Phase 0: trend-follow, breakout, momentum strategies. Winners can run 5-20%, locking in fixed ROI cuts the right tail.

Use both: strategies that catch both small mean-reversions AND occasional runners. Configure Phase 0 with longer time tiers and Phase 2 with higher activation so they don't compete.

Use neither (minimal_roi = {"0": 100.0} + trailing_stop = False): signal-exit-only strategies that rely entirely on populate_exit_trend. This is the most common pattern in the repo today and is frequently sub-optimal — most strategies benefit from at least one of Phase 0 or Phase 2.

Show full SKILL.md (201 more words)Show less

Reference implementation (drop into IStrategy)

python
stoploss = -0.05                # phase_1.max_loss_pct
trailing_stop = True
trailing_stop_positive = 0.015  # phase_2.trail_offset_pct
trailing_stop_positive_offset = 0.025  # phase_2.activate_at_pct
trailing_only_offset_is_reached = True  # do not trail until activate_at hit

def custom_exit(self, pair, trade, current_time, current_rate, current_profit, **kw):
    # Optional: enforce min_step_pct so micro-jitters do not churn orders.
    peak = trade.max_rate or trade.open_rate
    move_from_peak = (peak - current_rate) / peak
    if current_profit > 0.025 and move_from_peak >= 0.015 + 0.002:
        return "ratchet_trail"
    return None

Maker-first exit (pairs cleanly with fees-optimizations)

For strategies that can tolerate a few seconds of fill latency on exit, post the trail as ALO first and only escalate to taker if maker_timeout_sec elapses:

json
"exit_pricing": {"price_side": "same", "use_order_book": true, "order_book_top": 1},
"unfilledtimeout": {"entry": 3, "exit": 1, "unit": "minutes"}

Required pairing — without unfilledtimeout, a maker exit stalls indefinitely in trending markets and blocks the per-pair single-trade slot.

Honest framing

This primitive does not improve a losing strategy. Backtests on breakout show the trailing stop clips winners more often than it saves losers when the regime is wrong — that is expected. Use Phase 2 to lock in asymmetric R after the trade has already proven the thesis, not as a substitute for a regime filter.

Tunables

ParameterTypical rangeNotes
max_loss_pct0.03 – 0.08Tighter than 0.03 over-stops on normal vol; wider than 0.08 turns small losers into account-killers
activate_at_pct0.015 – 0.04Below 1.5R of typical entry slippage = activates on noise
trail_offset_pct0.01 – 0.025Smaller = more clipped winners; larger = bigger give-back
min_step_pct0.001 – 0.005Anti-churn band; raise on illiquid pairs

Backtest harness

Run a 3-variant parameter sweep on activate_at_pct × trail_offset_pct (Superior backtester supports parallel sweeps natively):

variants:
  - {activate_at_pct: 0.020, trail_offset_pct: 0.010}
  - {activate_at_pct: 0.025, trail_offset_pct: 0.015}  # reference
  - {activate_at_pct: 0.040, trail_offset_pct: 0.025}

Compare on profit factor and avg_winner / avg_loser ratio, not raw return — the engine's job is shape, not direction.

© Superior-Trade, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/dsl-exit-engine of Superior-Trade/superior-skills.

Open the folder on GitHubat commit 9d41db5

Compare with similar skills

Dsl Exit Engine next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dsl Exit Engine compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dsl Exit Engine this skillSuperior-Trade/superior-skills214—~1.7kAutomated safety check: PassMIT
Tushare Datazillionare/zillionare3212 repos~2.3kAutomated safety check: PassNone
Tradingview MCPatilaahmettaner/tradingview-mcp5k—~1.3kAutomated safety check: PassMIT
Digital Oraclekomako-workshop/digital-oracle875—~5.9kAutomated safety check: PassMIT
Polyclawchainstacklabs/polyclaw3591 repos~2kAutomated safety check: PassApache-2.0
Markdownfacioquo/stock-indicators-dotnet1.2k—~812Automated safety check: PassApache-2.0

Similar skills

  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    321 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Tradingview MCP

    atilaahmettaner/tradingview-mcp

    AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…

    5k GitHub stars~1.3k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Digital Oracle

    komako-workshop/digital-oracle

    Answer prediction questions using market trading data, not opinions.

    875 GitHub stars~5.9k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • Polyclaw

    chainstacklabs/polyclaw

    Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.

    359 GitHub starsUsed in 1 repo~2k tokens
    Business, Finance & HRAuto-check passed
  • Markdown

    facioquo/stock-indicators-dotnet

    Format and lint Markdown in this repository against GitHub Flavored Markdown and its markdownlint-cli2 configuration — headers, lists, code fences, callouts (VitePress containers on docs-site pages…

    1.2k GitHub stars~812 tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Openmobius Skill

    MobiusQuant/OpenMobius-skill

    Provides multi-school trading Q&A, chart/OHLCV analysis, annotation, and fresh-market workflows covering ICT/SMC, ChanLun, Wyckoff, Price Action, Order Flow, VSA, and Elliott Wave.

    695 GitHub stars~7.2k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed

More from Superior-Trade/superior-skills

All 31 skills in this repo
  • Superior Trade Auth

    Superior-Trade/superior-skills

    A skill your agent uses when an agent needs to register a Superior Trade account, verify an email OTP, configure x-api-key authentication, or recover from missing or invalid credentials before using…

    214 GitHub stars~950 tokensUpdated 29 days ago
    Auto-check passed
  • Deposit Qr

    Superior-Trade/superior-skills

    A skill your agent uses when a user needs a QR code or wallet payment URI to fund a Superior-managed EVM wallet on a specific chain before using Lighter, Polymarket, Hyperliquid, or other Superior…

    214 GitHub stars~1.1k tokensUpdated 29 days ago
    Auto-check passed
  • External Deposit

    Superior-Trade/superior-skills

    A skill your agent uses when a user wants to fund or bridge from an external wallet through a third-party UI such as Relay, especially when asking for MetaMask Mobile QR codes, bridge links…

    214 GitHub stars~1.7k tokensUpdated 29 days ago
    Auto-check passed
  • Aerodrome

    Superior-Trade/superior-skills

    A skill your agent uses when creating, validating, backtesting, deploying, sizing, or troubleshooting Aerodrome/Base spot trading strategies through the Superior Trade API, especially Freqtrade…

    214 GitHub stars~2.3k tokensUpdated 29 days ago
    Auto-check passed
  • Polymarket

    Superior-Trade/superior-skills

    A skill your agent uses when the user wants to trade, research, or backtest Polymarket prediction markets through Superior Trade — finding markets by slug or event URL, placing a single immediate…

    214 GitHub stars~4.2k tokensUpdated 29 days ago
    Auto-check passed
  • Backtesting

    Superior-Trade/superior-skills

    A skill your agent uses when running, interpreting, or designing backtests on Superior Trade — anything about backtest windows, trade-count thresholds, exit-reason mix, parameter sweeps…

    214 GitHub stars~2.9k tokensUpdated 29 days ago
    Auto-check passed

Questions about Dsl Exit Engine

What does Dsl Exit Engine do?

A skill your agent uses when designing or tuning exit logic for a Freqtrade strategy — ratcheting trailing stop, two-phase exit, ALO-aware exit, dynamic stoploss DSL, ROI ladder, take-profit ladder…. Dsl Exit Engine is an agent skill from Superior-Trade/superior-skills. Use when designing or tuning exit logic for a Freqtrade strategy — ratcheting trailing stop, two-phase exit, ALO-aware exit, dynamic stoploss DSL, ROI ladder, take-profit ladder, exit engine.

When should I use Dsl Exit Engine?

Dsl Exit Engine fits situations like: tuning exit logic for a Freqtrade strategy — ratcheting trailing stop; dynamic stoploss DSL; take-profit ladder.

How do I install Dsl Exit Engine in Claude Code?

Run `npx skills add Superior-Trade/superior-skills --skill dsl-exit-engine -a claude-code`. Or copy the skill folder (skills/dsl-exit-engine in Superior-Trade/superior-skills) into .claude/skills/dsl-exit-engine in your project. Claude Code loads it when a task matches its description.

How do I install Dsl Exit Engine in Codex?

Run `npx skills add Superior-Trade/superior-skills --skill dsl-exit-engine -a codex`. Or copy the skill folder (skills/dsl-exit-engine in Superior-Trade/superior-skills) into .agents/skills/dsl-exit-engine in your project. Codex loads it when a task matches its description.

Can I use Dsl Exit Engine in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Superior-Trade/superior-skills --skill dsl-exit-engine -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dsl-exit-engine, .gemini/skills/dsl-exit-engine, .github/skills/dsl-exit-engine and .opencode/skills/dsl-exit-engine in your project.

What does Dsl Exit Engine need to run?

SKILL.md names no scripts, command-line tools or credentials: Dsl Exit Engine is instructions for the agent only. Our summary lists: Python 3.

Does Dsl Exit Engine access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dsl Exit Engine safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dsl Exit Engine use?

Dsl Exit Engine is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dsl Exit Engine use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dsl Exit Engine?

Skills that share tags, products or a category with Dsl Exit Engine: Tushare Data (zillionare/zillionare, 321 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars), Digital Oracle (komako-workshop/digital-oracle, 875 stars) and Polyclaw (chainstacklabs/polyclaw, 359 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dsl Exit Engine?

Superior-Trade (a GitHub organization) maintains it in Superior-Trade/superior-skills, which has 214 GitHub stars. The repository holds 31 skills in this directory. The repository was last updated on September 10, 2026.

Source: Superior-Trade/superior-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.