autonomous-trading by senpi-ai/senpi-skills
npx skills add https://github.com/senpi-ai/senpi-skills --skill autonomous-trading为您的代理设定预算、目标和截止日期——然后让它进行交易。代理会创建策略钱包,扫描机会,开仓,使用 DSL 保护利润,并执行风险控制。
创建策略时,请在调用中包含 skill_name 和 skill_version。详情请参阅 references/skill-attribution.md。
首先安装这些配套技能:
最低预算: $500(建议 $1k+)
请参阅 references/bugs-and-gotchas.md — 来自实盘交易的关键问题,包括 dryRun 错误、幽灵平仓、XYZ DEX 保证金类型、层级 1 锁定的误解,以及扫描器杠杆与实际最大杠杆的差异。
收集:预算、目标、截止日期、风险承受能力(保守/适中/激进)、资产偏好。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
请参阅 references/risk-rules.md 获取按风险配置文件的完整风险规则。
v6 核心规则:
首要规则 — 小时趋势对齐。 所有交易必须与小时蜡烛结构确认。逆势 = 坚决跳过,没有例外。这一条规则防止了大部分亏损交易。
最大杠杆检查。 开仓前始终检查 max-leverage.json。扫描器杠杆是保守的,并非实际最大值。
集中优于分散。 在小账户规模($500-$10k)下,2-4 个高确信度头寸优于 6 个平庸的头寸。交叉保证金计算:4 个头寸 → 80.6% 保证金缓冲,2 个头寸 → 89.7%。
每个仓位必须最大化投资回报率。 空仓位 > 平庸头寸。如果一个头寸表现不佳,就平掉它并释放仓位。
速度过滤器。 最佳行情变动发生得很快(XRP 在 19 分钟内达到层级 3,XMR 在 37 分钟内达到层级 2)。慢速变动者是可疑的。
开仓前,检查总多头与空头名义价值。任一方向上限为 70%。
| 扫描器评分 | 头寸规模 |
|---|---|
| 250+ | 最高可达每头寸最大值 |
| 200-250 | 最大值的 75% |
| 175-200 | 最大值的 50% |
| < 175 | 跳过 |
strategy_create_strategy(budgetUsd, leverageType, riskLabel)
返回 strategyId + walletAddress。为钱包注资。
JSON 配置跟踪:风险配置文件、头寸限制、评分阈值、活跃头寸、交易日志。请参阅 references/playbook-schema.md。
竞态条件预防(v6 — 关键)
多个定时任务(扫描器、SM 翻转、DSL)都可能尝试平掉同一个头寸。当任何任务平仓时:
# 1. 平仓
result = close_position(wallet, asset)
# 2. 立即停用 DSL 状态文件
state["active"] = False
save_state(state)
# 3. 禁用该资产的 DSL 定时任务
disable_cron(f"dsl-{asset}")
这三个步骤必须在同一个操作中完成。这可以防止幽灵平仓。
定时任务计划:
| 任务 | 间隔 | 目的 |
|---|---|---|
| 机会扫描器 | 10-30 分钟(时间感知) | 寻找建仓机会 |
| DSL 监控器 | 每头寸 2-3 分钟 | 追踪止损 |
| SM 翻转检测器 | 5 分钟 | 确信度变化 |
| 投资组合更新 | 15 分钟 | 报告 |
请参阅 references/cron-setup.md 了解详细的定时任务配置、时间感知调度和 SM 翻转检测逻辑。
扫描 → 评估 → 交易 → 保护 → 重复
对于每个扫描结果:
1. 检查小时趋势对齐(硬性要求)
2. 检查方向性敞口防护
3. 通过 max-leverage.json 检查最大杠杆
4. 评分 ≥ 175? → 按评分层级确定规模
5. 开仓 → 创建 DSL 状态 → 启动 DSL 定时任务
6. 记录交易(入场时的扫描器快照)
| 条件 | 操作 |
|---|---|
| SM 确信度从 4 降至 1(例如,10 分钟内交易者从 220 降至 24) | 立即平仓 |
| 确信度为 0 的无效头寸 | 立即平仓 — 释放仓位 |
| 头寸停滞,有更好的机会可用 | 轮换 |
硬性止损(自动):
代理绝对不应做的事:
请参阅 references/lessons.md 了解来自实盘交易的有效方法、无效方法、回撤调整和费用意识。
请参阅 references/api-tools.md 了解此配方使用的关键 Senpi 工具。
每周安装次数
141
代码仓库
GitHub 星标数
53
首次出现
2026年2月27日
安全审计
安装于
github-copilot135
codex135
kimi-cli135
gemini-cli135
amp135
cline135
Give your agent a budget, a target, and a deadline — then let it trade. The agent creates a strategy wallet, scans for opportunities, opens positions, protects profits with DSL, and enforces risk controls.
When creating a strategy, include skill_name and skill_version in the call. See references/skill-attribution.md for details.
Install these companion skills first:
Minimum budget: $500 (recommend $1k+)
See references/bugs-and-gotchas.md — critical issues from live trading including the dryRun bug, phantom closes, XYZ DEX margin type, Tier 1 lock misconception, and scanner leverage vs actual max.
Collect: budget, target, deadline, risk tolerance (conservative/moderate/aggressive), asset preferences.
See references/risk-rules.md for complete risk rules by profile.
v6 Core Rules:
The #1 Rule — Hourly Trend Alignment. ALL trades must confirm with hourly candle structure. Counter-trend = hard skip, no exceptions. This single rule prevents the majority of losing trades.
Max Leverage Check. Always check max-leverage.json before entering. Scanner leverage is conservative, not actual max.
Concentration Over Diversification. At small account sizes ($500-$10k), 2-4 high-conviction positions beat 6 mediocre ones. Cross-margin math: 4 positions → 80.6% margin buffer, 2 positions → 89.7%.
Every Slot Must Maximize ROI. Empty slot > mediocre position. If a position isn't working, cut it and free the slot.
Speed Filter. Best moves happen FAST (XRP hit Tier 3 in 19 min, XMR Tier 2 in 37 min). Slow movers are suspects.
Before opening, check total LONG vs SHORT notional. Cap at 70% in one direction.
| Scanner Score | Position Size |
|---|---|
| 250+ | Up to max per-position |
| 200-250 | 75% of max |
| 175-200 | 50% of max |
| < 175 | Skip |
strategy_create_strategy(budgetUsd, leverageType, riskLabel)
Returns strategyId + walletAddress. Fund the wallet.
JSON config tracking: risk profile, position limits, score thresholds, active positions, trade journal. See references/playbook-schema.md.
Race Condition Prevention (v6 — CRITICAL)
Multiple cron jobs (scanner, SM flip, DSL) can all try to close the same position. When ANY job closes a position:
# 1. Close the position
result = close_position(wallet, asset)
# 2. Immediately deactivate DSL state file
state["active"] = False
save_state(state)
# 3. Disable DSL cron for this asset
disable_cron(f"dsl-{asset}")
All three steps MUST happen in the same action. This prevents phantom closes.
Cron Schedule:
| Job | Interval | Purpose |
|---|---|---|
| Opportunity Scanner | 10-30 min (time-aware) | Find setups |
| DSL Monitor | 2-3 min per position | Trailing stops |
| SM Flip Detector | 5 min | Conviction changes |
| Portfolio Update | 15 min | Reporting |
See references/cron-setup.md for detailed cron configuration, time-aware scheduling, and SM flip detection logic.
SCAN → EVALUATE → TRADE → PROTECT → REPEAT
For each scan result:
1. Check hourly trend alignment (HARD REQUIREMENT)
2. Check directional exposure guard
3. Check max leverage via max-leverage.json
4. Score ≥ 175? → Size by score tier
5. Open position → Create DSL state → Start DSL cron
6. Journal the trade (scanner snapshot at entry)
| Condition | Action |
|---|---|
| SM conviction drops 4→1 (e.g., 220→24 traders in 10 min) | Cut immediately |
| Dead weight at conviction 0 | Cut immediately — free the slot |
| Position stagnant, better opportunity available | Rotate |
Hard Stops (automatic):
What the Agent Should NEVER Do:
See references/lessons.md for what works, what doesn't, retrace tuning, and fee awareness from live trading.
See references/api-tools.md for the key Senpi tools used by this recipe.
Weekly Installs
141
Repository
GitHub Stars
53
First Seen
Feb 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
github-copilot135
codex135
kimi-cli135
gemini-cli135
amp135
cline135
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
40,000 周安装