dsl-tight

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DSL-Tight — Opinionated Stop-Loss Preset

DSL-Tight — 定制化止损预设

A tighter, more opinionated variant of DSL for aggressive profit protection. Same ROE-based engine as DSL v4 (
PnL / margin × 100
) — all tier triggers automatically account for leverage.
Key difference from DSL v4: DSL v4 is the configurable engine with maximum flexibility. DSL-Tight is the "just works" preset — fewer knobs, tighter defaults, per-tier breach counts, stagnation exits, and auto-calculated floors.
DSL的更严格、偏向预设配置的变体,用于实现激进的盈利保护。采用与DSL v4相同的基于ROE的引擎(
PnL / margin × 100
)——所有层级触发条件都会自动计算杠杆影响。
与DSL v4的核心差异: DSL v4是灵活性最高的可配置引擎,而DSL-Tight是“开箱即用”的预设——可调参数更少、默认阈值更严格、支持分层击穿计数、停滞离场功能以及自动计算底部价格。

Core Concept

核心概念

All thresholds defined in ROE. The script auto-converts to price levels:
price_floor = entry × (1 ± lockPct / 100 / leverage)
所有阈值均以ROE定义,脚本会自动转换为价格水平:
price_floor = entry × (1 ± lockPct / 100 / leverage)

How It Works

运行逻辑

Phase 1 — Absolute Floor (Stop-Loss)

阶段1 — 绝对底部(止损)

  • 5% ROE trailing floor
  • 3 consecutive breaches required
  • Auto-calculated absolute floor from entry/leverage/retrace
  • 5% ROE追踪底部
  • 需要连续3次击穿才会触发
  • 根据入场价/杠杆/回撤自动计算绝对底部

Phase 2 — Tiered Profit Lock

阶段2 — 分层盈利锁定

4 tiers that lock an increasing percentage of the high-water move:
TierTrigger ROELock % of HW MoveBreaches to Close
110%50%3
220%65%2
340%75%2
475%85%1
Per-tier breach counts tighten as profit grows — at Tier 4 (75% ROE), a single breach closes immediately.
4个层级,逐步锁定更高比例的最高水位涨幅:
层级触发ROE锁定最高水位涨幅比例触发平仓所需击穿次数
110%50%3
220%65%2
340%75%2
475%85%1
随盈利增长,每层所需击穿次数逐步收紧——到第4层级(75% ROE)时,单次击穿就会立即平仓。

Stagnation Take-Profit

停滞止盈

Auto-closes if:
  • ROE ≥ 8% AND
  • High-water mark hasn't improved for 1 hour
Catches winners that stall — takes the profit rather than waiting for a reversal.
满足以下条件时自动平仓:
  • ROE ≥ 8% 且
  • 最高水位标记已1小时未上涨
用于捕获停滞的盈利头寸——直接止盈而非等待行情反转。

Breach Mechanics

击穿机制

  • Hard decay only (breach count resets to 0 on recovery)
  • Per-tier breach requirements (3→2→2→1) replace the global Phase 1/Phase 2 split
  • Floor is always:
    max(tier_floor, trailing_floor)
    for LONG,
    min()
    for SHORT
  • 仅支持硬重置(价格恢复后击穿计数重置为0)
  • 分层击穿要求(3→2→2→1)替代了全局的阶段1/阶段2划分
  • 多头的底部价格始终为:
    max(层级底部, 追踪底部)
    ,空头则使用
    min()

State File Schema

状态文件Schema

json
{
  "active": true,
  "asset": "HYPE",
  "direction": "LONG",
  "leverage": 10,
  "entryPrice": 28.87,
  "size": 1890.28,
  "wallet": "0xYourStrategyWalletAddress",
  "strategyId": "uuid",
  "phase": 1,
  "phase1": {
    "retraceThreshold": 0.05,
    "consecutiveBreachesRequired": 3
  },
  "phase2TriggerTier": 0,
  "phase2": {
    "retraceThreshold": 0.015,
    "consecutiveBreachesRequired": 3
  },
  "tiers": [
    {"triggerPct": 10, "lockPct": 5, "retrace": 0.015, "breachesRequired": 3},
    {"triggerPct": 20, "lockPct": 13, "retrace": 0.012, "breachesRequired": 2},
    {"triggerPct": 40, "lockPct": 30, "retrace": 0.010, "breachesRequired": 2},
    {"triggerPct": 75, "lockPct": 64, "retrace": 0.006, "breachesRequired": 1}
  ],
  "breachDecay": "hard",
  "stagnation": {
    "enabled": true,
    "minRoePct": 8,
    "maxStaleSec": 3600
  },
  "currentTierIndex": -1,
  "tierFloorPrice": null,
  "highWaterPrice": 28.87,
  "floorPrice": null,
  "currentBreachCount": 0,
  "createdAt": "2026-02-23T10:00:00Z"
}
json
{
  "active": true,
  "asset": "HYPE",
  "direction": "LONG",
  "leverage": 10,
  "entryPrice": 28.87,
  "size": 1890.28,
  "wallet": "0xYourStrategyWalletAddress",
  "strategyId": "uuid",
  "phase": 1,
  "phase1": {
    "retraceThreshold": 0.05,
    "consecutiveBreachesRequired": 3
  },
  "phase2TriggerTier": 0,
  "phase2": {
    "retraceThreshold": 0.015,
    "consecutiveBreachesRequired": 3
  },
  "tiers": [
    {"triggerPct": 10, "lockPct": 5, "retrace": 0.015, "breachesRequired": 3},
    {"triggerPct": 20, "lockPct": 13, "retrace": 0.012, "breachesRequired": 2},
    {"triggerPct": 40, "lockPct": 30, "retrace": 0.010, "breachesRequired": 2},
    {"triggerPct": 75, "lockPct": 64, "retrace": 0.006, "breachesRequired": 1}
  ],
  "breachDecay": "hard",
  "stagnation": {
    "enabled": true,
    "minRoePct": 8,
    "maxStaleSec": 3600
  },
  "currentTierIndex": -1,
  "tierFloorPrice": null,
  "highWaterPrice": 28.87,
  "floorPrice": null,
  "currentBreachCount": 0,
  "createdAt": "2026-02-23T10:00:00Z"
}

Field Reference

字段说明

FieldPurpose
phase1.absoluteFloor
Not needed — auto-calculated from entry, leverage, retrace
tiers[].breachesRequired
Per-tier breach count (replaces global phase2 setting)
tiers[].retrace
Per-tier trailing stop tightness
stagnation.enabled
Enable stagnation take-profit
stagnation.minRoePct
Minimum ROE to trigger stagnation check
stagnation.maxStaleSec
Max seconds HW can be stale before auto-close
字段用途
phase1.absoluteFloor
无需手动配置——根据入场价、杠杆、回撤自动计算
tiers[].breachesRequired
每层所需击穿次数(替代全局阶段2设置)
tiers[].retrace
每层追踪止损的严格程度
stagnation.enabled
启用停滞止盈功能
stagnation.minRoePct
触发停滞检查的最低ROE
stagnation.maxStaleSec
最高水位停滞的最大秒数,超过则自动平仓

Cron Setup

Cron设置

Same as DSL v4:
DSL_STATE_FILE=/data/workspace/dsl-tight-HYPE.json python3 scripts/dsl-v4.py
Every 3 minutes per position. Script location:
scripts/dsl-v4.py
(same script as DSL v4).
与DSL v4一致:
DSL_STATE_FILE=/data/workspace/dsl-tight-HYPE.json python3 scripts/dsl-v4.py
每个头寸每3分钟执行一次。脚本路径:
scripts/dsl-v4.py
(与DSL v4使用相同脚本)。

Key Safety Features

核心安全特性

  • CLOSE_NO_POSITION
    graceful handling — if position already closed, deactivate cleanly
  • Auto-calculated floors eliminate manual math errors
  • Per-tier breach tightening means large profits get maximum protection
  • Stagnation TP prevents stalled winners from reversing
  • 优雅处理
    CLOSE_NO_POSITION
    情况——若头寸已平仓,会干净地停用策略
  • 自动计算底部价格避免手动计算错误
  • 分层击穿收紧机制可为大额盈利提供最高级别的保护
  • 停滞止盈功能避免盈利头寸停滞后续反转亏损

Example Walkthrough

示例流程

10x LONG entry at $28.87:
  1. Phase 1: Floor auto-calculated ~$28.73. Price rises, HW tracks.
  2. Tier 1 at 10% ROE ($29.16): Floor locks at ~$29.01, 3 breaches to close.
  3. Tier 2 at 20% ROE ($29.45): Floor locks at ~$29.24, now only 2 breaches.
  4. Stagnation: Price stalls at 12% ROE for 65 min → auto-closed with profit.
  5. Tier 4 at 75% ROE ($31.04): Floor at ~$30.71. Single breach = instant close.
10倍多头入场价$28.87:
  1. 阶段1:自动计算底部价格约为$28.73,价格上涨时最高水位同步更新。
  2. 层级1触发于10% ROE($29.16):底部锁定在约$29.01,需3次击穿才会平仓。
  3. 层级2触发于20% ROE($29.45):底部锁定在约$29.24,此时仅需2次击穿即可平仓。
  4. 停滞触发:价格在12% ROE位置停滞65分钟 → 自动止盈平仓。
  5. 层级4触发于75% ROE($31.04):底部约为$30.71,单次击穿即立即平仓。

Script Location

脚本位置

Uses the same
dsl-v4.py
script from the
dsl-dynamic-stop-loss
skill. Install that skill first, then use this state file template for the tighter preset.
dsl-dynamic-stop-loss
skill使用相同的
dsl-v4.py
脚本。请先安装该skill,再使用此状态文件模板启用更严格的预设配置。