orca-strategy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

🐋 ORCA v1.1 — Hardened Dual-Mode Scanner

🐋 ORCA v1.1 — 强化版双模式扫描器

Fox's brain. Vixen's architecture. Every lesson from 22 agents locked into the code.
Fox的核心逻辑,Vixen的架构。22个Agent的所有经验教训都被固化到代码中。

What v1.1 Fixes (DSL Audit)

v1.1修复内容(DSL审计)

The audit across all 22 agents revealed that every agent except Orca v1.0 had broken DSL configs. The root causes:
  1. consecutiveBreachesRequired: 1
    in Phase 1
    — meant a single price wick killed the position. Fox's entire losing streak traced to this. Fix: hardcoded to 3.
  2. deadWeightCutMinutes: 0
    — positions that never went positive sat for 30+ minutes bleeding. COPPER sat at 0% ROE for 36 hours on Fox. Fix: hardcoded to 10/15/20 by conviction.
  3. stagnationTp
    stripped by wolf_config.py builder
    — the function that merges configs silently dropped stagnation TP and conviction tiers. Dire Wolf, Jackal, and every Wolf-based agent was affected. Fix: DSL state template is now in the scanner output, bypassing all builders.
  4. dsl-v5.py reads top-level Phase 1 values, not per-tier — even when conviction tiers were present, the DSL engine read the top-level
    deadWeightCutMinutes: 0
    instead. Fix: scanner now sets the correct top-level values per-signal based on score.
v1.1 solution: The scanner outputs a complete
dslState
block for each signal. The agent writes this directly as the state file. No merging with dsl-profile.json. No wolf_config.py builder. No dynamic generation. The scanner is the single source of truth.
对所有22个Agent的审计显示,除Orca v1.0外,其他所有Agent的DSL配置均存在问题。根本原因如下:
  1. Phase 1中
    consecutiveBreachesRequired: 1
    —— 意味着单次价格插针就会平仓。Fox的全部亏损周期都源于此。修复方案:硬编码为3。
  2. deadWeightCutMinutes: 0
    —— 从未盈利的仓位会持仓30分钟以上持续亏损。Fox的COPPER仓位在0% ROE的状态下持仓了36小时。修复方案:根据置信度硬编码为10/15/20。
  3. wolf_config.py构建器移除了
    stagnationTp
    —— 合并配置的函数会静默丢弃滞涨止盈和置信度层级。Dire Wolf、Jackal及所有基于Wolf的Agent都受此影响。修复方案:扫描器输出中直接包含DSL状态模板,绕过所有构建器。
  4. dsl-v5.py读取顶层Phase 1值,而非分层值 —— 即使存在置信度层级,DSL引擎仍会读取顶层的
    deadWeightCutMinutes: 0
    。修复方案:扫描器现在会根据分数为每个信号设置正确的顶层值。
v1.1解决方案: 扫描器为每个信号输出完整的
dslState
块。Agent直接将其写入状态文件。无需与dsl-profile.json合并,无需使用wolf_config.py构建器,无需动态生成。扫描器是唯一的可信数据源。

Hardcoded Lessons (in the code, not instructions)

硬编码的经验教训(内置在代码中,而非仅作为指令)

Lesson SourceWhat HappenedGate in ORCA
Fox SNDK -$57XYZ equities are noise
xyz:
filtered at scan parse level
Dire Wolf 25x blowupAgent raised leverage after lossesLeverage capped 7-10x in scanner output
Vixen daily loss 25%Agent raised limit, bled 2.5x more10% daily loss in output constraints
PAXG double-entryAgent re-entered after Phase 1 cut2-hour per-asset cooldown enforced
Mantis removed stagnation TPPositions peaked then reversed to zeroStagnation TP mandatory in output constraints
Ghost Fox 740 tradesMore trades = more churn = more feesMax 3 positions, 6 entries/day
经验来源事件经过ORCA中的限制规则
Fox SNDK -$57XYZ股票都是无效噪音扫描解析阶段过滤
xyz:
Dire Wolf 25倍爆仓Agent在亏损后提高杠杆扫描器输出中杠杆上限设为7-10倍
Vixen每日亏损25%Agent提高亏损限制,最终亏损扩大2.5倍输出约束中设置10%每日亏损限制
PAXG重复入场Agent在Phase 1止损后重新入场强制单资产2小时冷却时间
Mantis移除滞涨止盈仓位达到峰值后回落至零输出约束中强制启用滞涨止盈
Ghost Fox 740笔交易交易越多=换手率越高=手续费越多最多3个仓位,每日最多6次入场

Dual-Mode Entry (Same as Vixen/Fox)

双模式入场规则(与Vixen/Fox一致)

MODE A — STALKER (Accumulation)

模式A —— STALKER(建仓模式)

  • SM rank climbing steadily over 3+ consecutive scans
  • Contribution building each scan
  • 4H trend aligned
  • Score >= 6
  • SM排名在连续3次以上扫描中稳步上升
  • 每次扫描的贡献值持续增加
  • 4小时趋势一致
  • 分数≥6

MODE B — STRIKER (Explosion)

模式B —— STRIKER(爆发模式)

  • FIRST_JUMP or IMMEDIATE_MOVER (10+ rank jump from #25+)
  • Rank jump >= 15 OR velocity > 15
  • Raw volume >= 1.5x of 6h average
  • Score >= 9, minimum 4 reasons
  • FIRST_JUMP或IMMEDIATE_MOVER(从25名以外跃升10名以上)
  • 排名跃升≥15 或 速度>15
  • 原始成交量≥6小时平均成交量的1.5倍
  • 分数≥9,至少4个理由

MANDATORY: DSL High Water Mode

强制要求:DSL高水位模式

ORCA MUST use DSL High Water Mode. This is not optional.
json
{
  "lockMode": "pct_of_high_water",
  "phase2TriggerRoe": 7,
  "tiers": [
    {"triggerPct": 7,  "lockHwPct": 40, "consecutiveBreachesRequired": 3},
    {"triggerPct": 12, "lockHwPct": 55, "consecutiveBreachesRequired": 2},
    {"triggerPct": 15, "lockHwPct": 75, "consecutiveBreachesRequired": 2},
    {"triggerPct": 20, "lockHwPct": 85, "consecutiveBreachesRequired": 1}
  ]
}
ORCA必须使用DSL高水位模式,无例外。
json
{
  "lockMode": "pct_of_high_water",
  "phase2TriggerRoe": 7,
  "tiers": [
    {"triggerPct": 7,  "lockHwPct": 40, "consecutiveBreachesRequired": 3},
    {"triggerPct": 12, "lockHwPct": 55, "consecutiveBreachesRequired": 2},
    {"triggerPct": 15, "lockHwPct": 75, "consecutiveBreachesRequired": 2},
    {"triggerPct": 20, "lockHwPct": 85, "consecutiveBreachesRequired": 1}
  ]
}

Phase 1 (Conviction-Scaled)

Phase 1(置信度分层)

ScoreAbsolute FloorHard TimeoutWeak PeakDead Weight
6-7 (Stalker)-20% ROE30 min15 min10 min
8-9-25% ROE45 min20 min15 min
10+ (Striker)-30% ROE60 min30 min20 min
分数绝对止损线强制超时时间弱势峰值止损时间无效持仓止损时间
6-7(Stalker模式)-20% ROE30分钟15分钟10分钟
8-9-25% ROE45分钟20分钟15分钟
10+(Striker模式)-30% ROE60分钟30分钟20分钟

Stagnation TP (MANDATORY — do not remove)

滞涨止盈(强制要求——不得移除)

If ROE >= 10% and high water hasn't moved for 45 minutes, take profit. Fox has this. Mantis removed it and underperformed. This is not optional.
当ROE≥10%且高水位在45分钟内未变动时,执行止盈。Fox采用此规则,Mantis移除后表现下滑。此规则无例外。

Scanner Output — DSL State Template (v1.1)

扫描器输出——DSL状态模板(v1.1)

Each signal in
combined
includes a
dslState
block. The agent MUST write this block directly as the DSL state file after opening a position. Do not merge with dsl-profile.json. Do not use wolf_config.py. Do not generate your own DSL config.
The
dslState
includes:
  • phase1.consecutiveBreachesRequired: 3
    (NOT 1 — Fox's biggest bug)
  • phase1.deadWeightCutMinutes
    set per-score (10/15/20 — NOT 0)
  • phase1.hardTimeoutMinutes
    set per-score (30/45/60)
  • phase1.weakPeakCutMinutes
    set per-score (15/20/30)
  • stagnationTp: {"enabled": true, "roeMin": 10, "hwStaleMin": 45}
  • Full tier table with correct per-tier breaches (3/2/2/1)
Entry flow:
  1. Scanner outputs signal with
    dslState
    block
  2. Agent calls
    strategy_create_position
    with coin, direction, leverage, margin
  3. Agent writes
    state/{TOKEN}.json
    with the exact contents of
    signal.dslState
    , plus
    entryPrice
    ,
    leverage
    , and
    createdAt
  4. Agent sends ONE notification: position opened
  5. DSL cron (3 min) picks up the state file and manages the position
If step 3 is skipped, the position is NAKED — no stop loss protection.
combined
中的每个信号都包含一个
dslState
块。Agent必须在开仓后直接将此块写入DSL状态文件。 不得与dsl-profile.json合并,不得使用wolf_config.py,不得自行生成DSL配置。
dslState
包含:
  • phase1.consecutiveBreachesRequired: 3
    (而非1——Fox的最大漏洞)
  • phase1.deadWeightCutMinutes
    根据分数设置(10/15/20——而非0)
  • phase1.hardTimeoutMinutes
    根据分数设置(30/45/60)
  • phase1.weakPeakCutMinutes
    根据分数设置(15/20/30)
  • stagnationTp: {"enabled": true, "roeMin": 10, "hwStaleMin": 45}
  • 完整的层级表,包含正确的分层止损要求(3/2/2/1)
入场流程:
  1. 扫描器输出包含
    dslState
    块的信号
  2. Agent调用
    strategy_create_position
    ,传入币种、方向、杠杆、保证金
  3. Agent将
    signal.dslState
    的精确内容加上
    entryPrice
    leverage
    createdAt
    写入
    state/{TOKEN}.json
  4. Agent发送一条通知:仓位已开仓
  5. DSL定时任务(每3分钟)读取状态文件并管理仓位
如果跳过步骤3,仓位将处于“裸仓”状态——无止损保护。

Scanner Output Constraints

扫描器输出约束

The scanner includes a
constraints
block in every output that the agent MUST respect:
json
{
  "constraints": {
    "minLeverage": 7,
    "maxLeverage": 10,
    "maxPositions": 3,
    "maxDailyLossPct": 10,
    "xyzBanned": true,
    "assetCooldownMinutes": 120,
    "stagnationTp": {"enabled": true, "roeMin": 10, "hwStaleMin": 45},
    "dslTiers": [
      {"triggerPct": 7,  "lockHwPct": 40, "consecutiveBreachesRequired": 3},
      {"triggerPct": 12, "lockHwPct": 55, "consecutiveBreachesRequired": 2},
      {"triggerPct": 15, "lockHwPct": 75, "consecutiveBreachesRequired": 2},
      {"triggerPct": 20, "lockHwPct": 85, "consecutiveBreachesRequired": 1}
    ]
  }
}
These are hardcoded constants in the scanner Python code. They cannot be changed via config.
扫描器在每个输出中都包含一个
constraints
块,Agent必须遵守:
json
{
  "constraints": {
    "minLeverage": 7,
    "maxLeverage": 10,
    "maxPositions": 3,
    "maxDailyLossPct": 10,
    "xyzBanned": true,
    "assetCooldownMinutes": 120,
    "stagnationTp": {"enabled": true, "roeMin": 10, "hwStaleMin": 45},
    "dslTiers": [
      {"triggerPct": 7,  "lockHwPct": 40, "consecutiveBreachesRequired": 3},
      {"triggerPct": 12, "lockHwPct": 55, "consecutiveBreachesRequired": 2},
      {"triggerPct": 15, "lockHwPct": 75, "consecutiveBreachesRequired": 2},
      {"triggerPct": 20, "lockHwPct": 85, "consecutiveBreachesRequired": 1}
    ]
  }
}
这些是扫描器Python代码中的硬编码常量,无法通过配置修改。

Risk Management

风险管理

RuleValueWhy
Max positions3Concentration > diversification
Max entries/day6Fewer trades wins
Leverage7-10xSub-7x can't overcome fees; 15x blows up
Daily loss limit10%Vixen at 25% bled 2.5x more
Per-asset cooldown2 hoursPAXG double-entry lesson
Stagnation TP10% ROE / 45 minCaptures peaks that flatline
XYZ equitiesBannedNet negative across every agent that traded them
规则数值原因
最大仓位数量3集中持仓优于分散持仓
每日最大入场次数6交易越少胜率越高
杠杆7-10倍低于7倍无法覆盖手续费;15倍以上易爆仓
每日亏损限制10%Vixen曾因设置25%亏损限制,最终亏损扩大2.5倍
单资产冷却时间2小时吸取PAXG重复入场的教训
滞涨止盈10% ROE / 45分钟捕捉达到峰值后横盘的利润
XYZ股票禁止交易所有交易过该类股票的Agent均出现净亏损

Cron Architecture

定时任务架构

CronIntervalSessionPurpose
Scanner90smainDual-mode emerging movers detection
DSL v53 minisolatedHigh Water Mode trailing stops
定时任务间隔会话用途
扫描器90秒main双模式新兴异动检测
DSL v53分钟isolated高水位模式追踪止损

Notification Policy

通知策略

ONLY alert: Position OPENED (mode, asset, direction, score, reasons), position CLOSED (DSL or Phase 1 with reason), risk guardian triggered, critical error.
NEVER alert: Scanner ran with no signals, signals filtered, DSL routine check, system status, any reasoning.
Standing rule: Do not modify config, scoring thresholds, DSL tiers, leverage limits, or entry parameters without explicit approval from Jason. Silence means working.
仅发送以下通知: 仓位已开仓(模式、资产、方向、分数、理由)、仓位已平仓(DSL或Phase 1止损,附原因)、风险预警触发、严重错误。
禁止发送以下通知: 扫描器运行无信号、信号被过滤、DSL例行检查、系统状态、任何推理过程。
固定规则: 未经Jason明确批准,不得修改配置、评分阈值、DSL层级、杠杆限制或入场参数。无消息即表示运行正常。

Bootstrap Gate

启动检查

On EVERY session, check
config/bootstrap-complete.json
. If missing:
  1. Verify Senpi MCP
  2. Create scanner cron (90s, main) and DSL cron (3 min, isolated)
  3. Write
    config/bootstrap-complete.json
  4. Send: "🐋 ORCA v1.0 is online. Hardened dual-mode scanner active. All gates enforced in code. Silence = no conviction."
每次会话启动时,检查
config/bootstrap-complete.json
。如果文件缺失:
  1. 验证Senpi MCP
  2. 创建扫描器定时任务(90秒,main会话)和DSL定时任务(3分钟,isolated会话)
  3. 写入
    config/bootstrap-complete.json
  4. 发送通知:"🐋 ORCA v1.0已上线。强化版双模式扫描器已激活。所有限制规则均内置在代码中。无消息即表示无合适交易信号。"

Files

文件说明

FilePurpose
scripts/orca-scanner.py
Dual-mode scanner with hardcoded gates
scripts/orca_config.py
Self-contained config helper
config/orca-config.json
Fox's exact winning configuration
文件用途
scripts/orca-scanner.py
内置限制规则的双模式扫描器
scripts/orca_config.py
独立的配置辅助工具
config/orca-config.json
Fox的最优获胜配置

License

许可证

MIT协议 —— 由Senpi开发(https://senpi.ai)。 源码:https://github.com/Senpi-ai/senpi-skills