dsl-tight
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDSL-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 () — all tier triggers automatically account for leverage.
PnL / margin × 100Key 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:
| Tier | Trigger ROE | Lock % of HW Move | Breaches to Close |
|---|---|---|---|
| 1 | 10% | 50% | 3 |
| 2 | 20% | 65% | 2 |
| 3 | 40% | 75% | 2 |
| 4 | 75% | 85% | 1 |
Per-tier breach counts tighten as profit grows — at Tier 4 (75% ROE), a single breach closes immediately.
4个层级,逐步锁定更高比例的最高水位涨幅:
| 层级 | 触发ROE | 锁定最高水位涨幅比例 | 触发平仓所需击穿次数 |
|---|---|---|---|
| 1 | 10% | 50% | 3 |
| 2 | 20% | 65% | 2 |
| 3 | 40% | 75% | 2 |
| 4 | 75% | 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: for LONG,
max(tier_floor, trailing_floor)for SHORTmin()
- 仅支持硬重置(价格恢复后击穿计数重置为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
字段说明
| Field | Purpose |
|---|---|
| Not needed — auto-calculated from entry, leverage, retrace |
| Per-tier breach count (replaces global phase2 setting) |
| Per-tier trailing stop tightness |
| Enable stagnation take-profit |
| Minimum ROE to trigger stagnation check |
| Max seconds HW can be stale before auto-close |
| 字段 | 用途 |
|---|---|
| 无需手动配置——根据入场价、杠杆、回撤自动计算 |
| 每层所需击穿次数(替代全局阶段2设置) |
| 每层追踪止损的严格程度 |
| 启用停滞止盈功能 |
| 触发停滞检查的最低ROE |
| 最高水位停滞的最大秒数,超过则自动平仓 |
Cron Setup
Cron设置
Same as DSL v4:
DSL_STATE_FILE=/data/workspace/dsl-tight-HYPE.json python3 scripts/dsl-v4.pyEvery 3 minutes per position. Script location: (same script as DSL v4).
scripts/dsl-v4.py与DSL v4一致:
DSL_STATE_FILE=/data/workspace/dsl-tight-HYPE.json python3 scripts/dsl-v4.py每个头寸每3分钟执行一次。脚本路径:(与DSL v4使用相同脚本)。
scripts/dsl-v4.pyKey Safety Features
核心安全特性
- graceful handling — if position already closed, deactivate cleanly
CLOSE_NO_POSITION - 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:
- Phase 1: Floor auto-calculated ~$28.73. Price rises, HW tracks.
- Tier 1 at 10% ROE ($29.16): Floor locks at ~$29.01, 3 breaches to close.
- Tier 2 at 20% ROE ($29.45): Floor locks at ~$29.24, now only 2 breaches.
- Stagnation: Price stalls at 12% ROE for 65 min → auto-closed with profit.
- Tier 4 at 75% ROE ($31.04): Floor at ~$30.71. Single breach = instant close.
10倍多头入场价$28.87:
- 阶段1:自动计算底部价格约为$28.73,价格上涨时最高水位同步更新。
- 层级1触发于10% ROE($29.16):底部锁定在约$29.01,需3次击穿才会平仓。
- 层级2触发于20% ROE($29.45):底部锁定在约$29.24,此时仅需2次击穿即可平仓。
- 停滞触发:价格在12% ROE位置停滞65分钟 → 自动止盈平仓。
- 层级4触发于75% ROE($31.04):底部约为$30.71,单次击穿即立即平仓。
Script Location
脚本位置
Uses the same script from the skill. Install that skill first, then use this state file template for the tighter preset.
dsl-v4.pydsl-dynamic-stop-loss与 skill使用相同的脚本。请先安装该skill,再使用此状态文件模板启用更严格的预设配置。
dsl-dynamic-stop-lossdsl-v4.py