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:
- in Phase 1 — meant a single price wick killed the position. Fox's entire losing streak traced to this. Fix: hardcoded to 3.
consecutiveBreachesRequired: 1 - — 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.
deadWeightCutMinutes: 0 - 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.
stagnationTp - 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 instead. Fix: scanner now sets the correct top-level values per-signal based on score.
deadWeightCutMinutes: 0
v1.1 solution: The scanner outputs a complete 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.
dslState对所有22个Agent的审计显示,除Orca v1.0外,其他所有Agent的DSL配置均存在问题。根本原因如下:
- Phase 1中—— 意味着单次价格插针就会平仓。Fox的全部亏损周期都源于此。修复方案:硬编码为3。
consecutiveBreachesRequired: 1 - —— 从未盈利的仓位会持仓30分钟以上持续亏损。Fox的COPPER仓位在0% ROE的状态下持仓了36小时。修复方案:根据置信度硬编码为10/15/20。
deadWeightCutMinutes: 0 - wolf_config.py构建器移除了—— 合并配置的函数会静默丢弃滞涨止盈和置信度层级。Dire Wolf、Jackal及所有基于Wolf的Agent都受此影响。修复方案:扫描器输出中直接包含DSL状态模板,绕过所有构建器。
stagnationTp - dsl-v5.py读取顶层Phase 1值,而非分层值 —— 即使存在置信度层级,DSL引擎仍会读取顶层的。修复方案:扫描器现在会根据分数为每个信号设置正确的顶层值。
deadWeightCutMinutes: 0
v1.1解决方案: 扫描器为每个信号输出完整的块。Agent直接将其写入状态文件。无需与dsl-profile.json合并,无需使用wolf_config.py构建器,无需动态生成。扫描器是唯一的可信数据源。
dslStateHardcoded Lessons (in the code, not instructions)
硬编码的经验教训(内置在代码中,而非仅作为指令)
| Lesson Source | What Happened | Gate in ORCA |
|---|---|---|
| Fox SNDK -$57 | XYZ equities are noise | |
| Dire Wolf 25x blowup | Agent raised leverage after losses | Leverage capped 7-10x in scanner output |
| Vixen daily loss 25% | Agent raised limit, bled 2.5x more | 10% daily loss in output constraints |
| PAXG double-entry | Agent re-entered after Phase 1 cut | 2-hour per-asset cooldown enforced |
| Mantis removed stagnation TP | Positions peaked then reversed to zero | Stagnation TP mandatory in output constraints |
| Ghost Fox 740 trades | More trades = more churn = more fees | Max 3 positions, 6 entries/day |
| 经验来源 | 事件经过 | ORCA中的限制规则 |
|---|---|---|
| Fox SNDK -$57 | 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(置信度分层)
| Score | Absolute Floor | Hard Timeout | Weak Peak | Dead Weight |
|---|---|---|---|---|
| 6-7 (Stalker) | -20% ROE | 30 min | 15 min | 10 min |
| 8-9 | -25% ROE | 45 min | 20 min | 15 min |
| 10+ (Striker) | -30% ROE | 60 min | 30 min | 20 min |
| 分数 | 绝对止损线 | 强制超时时间 | 弱势峰值止损时间 | 无效持仓止损时间 |
|---|---|---|---|---|
| 6-7(Stalker模式) | -20% ROE | 30分钟 | 15分钟 | 10分钟 |
| 8-9 | -25% ROE | 45分钟 | 20分钟 | 15分钟 |
| 10+(Striker模式) | -30% ROE | 60分钟 | 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 includes a 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.
combineddslStateThe includes:
dslState- (NOT 1 — Fox's biggest bug)
phase1.consecutiveBreachesRequired: 3 - set per-score (10/15/20 — NOT 0)
phase1.deadWeightCutMinutes - set per-score (30/45/60)
phase1.hardTimeoutMinutes - set per-score (15/20/30)
phase1.weakPeakCutMinutes stagnationTp: {"enabled": true, "roeMin": 10, "hwStaleMin": 45}- Full tier table with correct per-tier breaches (3/2/2/1)
Entry flow:
- Scanner outputs signal with block
dslState - Agent calls with coin, direction, leverage, margin
strategy_create_position - Agent writes with the exact contents of
state/{TOKEN}.json, plussignal.dslState,entryPrice, andleveragecreatedAt - Agent sends ONE notification: position opened
- 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.
combineddslStatedslState- (而非1——Fox的最大漏洞)
phase1.consecutiveBreachesRequired: 3 - 根据分数设置(10/15/20——而非0)
phase1.deadWeightCutMinutes - 根据分数设置(30/45/60)
phase1.hardTimeoutMinutes - 根据分数设置(15/20/30)
phase1.weakPeakCutMinutes stagnationTp: {"enabled": true, "roeMin": 10, "hwStaleMin": 45}- 完整的层级表,包含正确的分层止损要求(3/2/2/1)
入场流程:
- 扫描器输出包含块的信号
dslState - Agent调用,传入币种、方向、杠杆、保证金
strategy_create_position - Agent将的精确内容加上
signal.dslState、entryPrice和leverage写入createdAtstate/{TOKEN}.json - Agent发送一条通知:仓位已开仓
- DSL定时任务(每3分钟)读取状态文件并管理仓位
如果跳过步骤3,仓位将处于“裸仓”状态——无止损保护。
Scanner Output Constraints
扫描器输出约束
The scanner includes a block in every output that the agent MUST respect:
constraintsjson
{
"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.
扫描器在每个输出中都包含一个块,Agent必须遵守:
constraintsjson
{
"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
风险管理
| Rule | Value | Why |
|---|---|---|
| Max positions | 3 | Concentration > diversification |
| Max entries/day | 6 | Fewer trades wins |
| Leverage | 7-10x | Sub-7x can't overcome fees; 15x blows up |
| Daily loss limit | 10% | Vixen at 25% bled 2.5x more |
| Per-asset cooldown | 2 hours | PAXG double-entry lesson |
| Stagnation TP | 10% ROE / 45 min | Captures peaks that flatline |
| XYZ equities | Banned | Net 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
定时任务架构
| Cron | Interval | Session | Purpose |
|---|---|---|---|
| Scanner | 90s | main | Dual-mode emerging movers detection |
| DSL v5 | 3 min | isolated | High Water Mode trailing stops |
| 定时任务 | 间隔 | 会话 | 用途 |
|---|---|---|---|
| 扫描器 | 90秒 | main | 双模式新兴异动检测 |
| DSL v5 | 3分钟 | 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 . If missing:
config/bootstrap-complete.json- Verify Senpi MCP
- Create scanner cron (90s, main) and DSL cron (3 min, isolated)
- Write
config/bootstrap-complete.json - Send: "🐋 ORCA v1.0 is online. Hardened dual-mode scanner active. All gates enforced in code. Silence = no conviction."
每次会话启动时,检查。如果文件缺失:
config/bootstrap-complete.json- 验证Senpi MCP
- 创建扫描器定时任务(90秒,main会话)和DSL定时任务(3分钟,isolated会话)
- 写入
config/bootstrap-complete.json - 发送通知:"🐋 ORCA v1.0已上线。强化版双模式扫描器已激活。所有限制规则均内置在代码中。无消息即表示无合适交易信号。"
Files
文件说明
| File | Purpose |
|---|---|
| Dual-mode scanner with hardcoded gates |
| Self-contained config helper |
| Fox's exact winning configuration |
| 文件 | 用途 |
|---|---|
| 内置限制规则的双模式扫描器 |
| 独立的配置辅助工具 |
| Fox的最优获胜配置 |
License
许可证
MIT — Built by Senpi (https://senpi.ai).
Source: https://github.com/Senpi-ai/senpi-skills
MIT协议 —— 由Senpi开发(https://senpi.ai)。
源码:https://github.com/Senpi-ai/senpi-skills