Skip to content
Agentmart
Submit a tool

5minbtc

BTC 5分钟K线实时方向预测 + 币安预测市场错价套利(paper)。v6.0 真OFI驱动: 方向由当前K线原生 in-candle OFI 净流一票决定(ofi_n=2*(tb/v)-1, REST klines[9] 聚合, 零WS依赖; WS ofi.json 做新鲜度反转保护与交叉校准)…

Skill by aAAaqwq

IndexedMIT★ 111
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/aaaaqwq-5minbtc

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

BTC 5分钟K线实时方向预测 + 币安预测市场错价套利(paper)。v6.0 真OFI驱动: 方向由当前K线原生 in-candle OFI 净流一票决定(ofi_n=2*(tb/v)-1, REST klines[9] 聚合, 零WS依赖; WS ofi.json 做新鲜度反转保护与交叉校准), 概率=P(close>open|ofi) 经验校准表+Bayesian shrink, edge=EV=p−ask 错价检测, 方向二选一无中性。13因子自v5.9起收敛到3个有证据信号且不再决定bias。黑天鹅防护: ATR spike+FNG<25。launchd 常驻 realtime/watch/trader。⚠️ Binance 端点**人工**双向切换(引擎为单端点硬依赖,无自动故障切换;2026-09-11 曾因 data-api SSL 失败静默断档 6h)。

Use cases: backend, data, research

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/5minbtc

What's inside

Skill name
5minbtc
Description
BTC 5分钟K线实时方向预测 + 币安预测市场错价套利(paper)。v6.0 真OFI驱动: 方向由当前K线原生 in-candle OFI 净流一票决定(ofi_n=2*(tb/v)-1, REST klines[9] 聚合, 零WS依赖; WS ofi.json 做新鲜度反转保护与交叉校准), 概率=P(close>open|ofi) 经验校准表+Bayesian shrink, edge=EV=p−ask 错价检测, 方向二选一无中性。13因子自v5.9起收敛到3个有证据信号且不再决定bias。黑天鹅防护: ATR spike+FNG<25。launchd 常驻 realtime/watch/trader。⚠️ Binance 端点**人工**双向切换(引擎为单端点硬依赖,无自动故障切换;2026-09-11 曾因 data-api SSL 失败静默断档 6h)。
License
MIT
Instructions
234 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Agent Skills spec issues

  • body: contains an absolute path from the author's machine

Files (77)

  • .env.example
  • .gitignore
  • 5minbtc-engine-v6.0.py
  • 5minbtc-log.py
  • 5minbtc-news.py
  • README.md
  • SKILL.md
  • README.md · backtest/
  • fetch_data.py · backtest/
  • backtest_20260527_2328.json · backtest/results/
  • backtest_v57_20260528_1433.json · backtest/results/
  • backtest_v58_1min_20260528_2018.json · backtest/results/
  • backtest_v58_1min_20260528_2019.json · backtest/results/
  • backtest_v58_1min_20260528_2020.json · backtest/results/
  • latest_summary.json · backtest/results/
  • latest_v57_summary.json · backtest/results/
  • latest_v58_1min_summary.json · backtest/results/
  • run.sh · backtest/
  • run_backtest.py · backtest/
  • run_backtest_v57.py · backtest/
  • run_backtest_v58.py · backtest/
  • 5minbtc-log.2026-08.jsonl.gz · logs/archive/
  • 5minbtc-log.2026-09.jsonl.gz · logs/archive/
  • archive.md · references/
  • backtest-findings.md · references/
  • backtest-v58-1min-findings.md · references/
  • binance-api-geo.md · references/
  • binance-endpoint-flapping.md · references/
  • changelog.md · references/
  • cron-llm-provider-failure.md · references/
  • execution.md · references/
  • high-latency-network-handling.md · references/
  • lessons.md · references/
  • monitoring-claude-code.md · references/
  • news-sources.md · references/
  • output-template.md · references/
  • pitfalls.md · references/
  • prediction-market-strategy.md · references/
  • prediction-trading-cli.md · references/
  • quant-knowledge-index.md · references/
  • review-procedure.md · references/
  • scheduled-tasks.md · references/
  • setup-from-scratch.md · references/
  • skill-organization.md · references/
  • strategy-adversarial-review.md · references/
  • sync-procedure.md · references/
  • telegram-push-monitor.md · references/
  • R01-factor-theory.md · reports/
  • R02-strategy-theory.md · reports/
  • R03-crypto-quant-defi.md · reports/
  • R04-portfolio-theory.md · reports/
  • R05-ml-quant-trading.md · reports/
  • R06-data-sources.md · reports/
  • R07-frontier-research-2024-2026.md · reports/
  • R08-options-volatility.md · reports/
  • R09-market-microstructure.md · reports/
  • R10-risk-management-frontier.md · reports/
  • R11-institutional-methodology.md · reports/
  • R12-integration-blueprint.md · reports/
  • R13-accuracy-optimization-plan.md · reports/
  • …and 17 more

SKILL.md (first lines)

# 5minbtc — BTC 5分钟实时预测 v6.0.0

> BTC 单根 5min K线 方向 + 收盘价预测。引擎+LLM 混合架构。
> **SKILL.md 是索引, 详细内容见 `references/`。**
> **v5.9 认知转变**: 从"13因子预测器"→"3信号错价检测器" — 方向准确率不是 edge, `EV = p − P − 成本` 才是 (见 [对抗式审查报告](references/strategy-adversarial-review.md))
> **v6.0 执行转变**: 方向从"body 延续统计"改成**真 OFI 净流一票决定** — 赌的是"净流已发生、token 价还没定价"的 flow-gap

> ⚠️ **同名易混**: 本 skill 只做 BTC 单标的 5min 方向 + 预测市场 EV。要做全市场永续的量价突破扫描, 用 [`coin-vp-scanner`](../coin-vp-scanner/SKILL.md) — 两者区别见下方 [与 coin-vp-scanner 的分工](#与-coin-vp-scanner-的分工)。

## 触发
`5minbtc` / `5min btc` / `btc 5min` / `监控` (配合持续盯盘)

## 何时使用
| 场景 | 做法 |
|------|------|
| 当前 5min K线 方向+价位 | ✅ 标准流程, **方向=OFI 净流, edge=错价 EV** (v5.8 零前视回测 61.4% 是延续性不是 alpha, 见性能快照) |
| 会话内持续盯盘, 等明确信号 | ✅ 监控模式 (scripts/5minbtc-monitor.py + Monitor 工具) |
| 币安预测市场 Up/Down 5m 交易 | ✅ paper 模拟/实时监控 (见 [预测市场策略](references/prediction-market-strategy.md)) |
| "今晚 BTC 涨跌" (宽窗口) | ⚠️ 跑当前 K线 + 给方向倾向, 标注"超出引擎置信区间" |
| "下根 K线" / "1小时后" | 引导在该 K线 起始时间再触发 |

## 监控模式 (Claude Code)

> 详见 [monitoring-claude-code.md](references/monitoring-claude-code.md)

```bash
# 无限持续, 直到用户喊停 (会话内盯盘推荐)
Monitor(command: "python3 <SKILL>/scripts/5minbtc-monitor.py --max-runs 0", persistent: true)

# 默认 20 次采样 (约 40 分钟)
python3 <SKILL>/scripts/5minbtc-monitor.py

# 单次判断 (非持续)
python3 <SKILL>/scripts/5minbtc-monitor.py --dry-run
```

- **明确信号** = bias 非中性 + strength∈{medium,moderate,strong} + conf≥50 → 自动停
  (⚠️ 实测引擎 strength 输出 `medium`, 判定集合需同时含 `medium` 和 `moderate`)
- 每根 K 线第 2/3 分钟采样 (progress ~40-70%), 比 cron 第 4 分钟更早
- 事件流: `START` / `DIR-CHANGE` / `CLEAR-SIGNAL` / `ENGINE-ERR` / `MAX-RUNS`
- 停止: 用户说「停/结束」→ `TaskStop` 停 Monitor
- `CLEAR-SIGNAL` 后必须拉一次完整引擎快照二次确认
- 引擎验证: `python3 scripts/test_engine.py` (13 项, 自带 runner **无需 pytest**; 慢测加 `--slow`)
  — 装了 pytest 也可 `python3 -m pytest scripts/test_engine.py -v`
  (原文件名 `test_engine_v58.py` 带版本号, 引擎升到 v6.0 后即漂移, 2026-09-10 改为不带版本号)

## 快速开始

```bash
SKILL_DIR=/home/aa/.hermes/profiles/cqo/skills/5minbtc

# 1. 并行: 引擎 + 新闻 + settle (前一根)
python3 $SKILL_DIR/5minbtc-log.py settle-all 2>&1
python3 $SKILL_DIR/5minbtc-engine-v6.0.py 2>&1
python3 $SKILL_DIR/5minbtc-news.py 2>&1

# 2. 3 路 web_search (并行)
# "Bitcoin BTC breaking news price" / "crypto market macro stocks today" / "比特币 BTC 最新 晚间"

# 3. LLM 分析 → 输出 (见 output-template.md)
# 4. 写日志
python3 $SKILL_DIR/5minbtc-log.py log \
  "<candle.iso>" <pred_close> <pred_high> <pred_low> \
  <conf> <bias> <news_sent> <vol_pct>
```

## 架构 (1 行/组件)
- **引擎** `5minbtc-engine-v6.0.py` (v6.0, 输出 `"version": "6.0.0"`): **bias 由真 OFI 净流一票决定** (ofi_n>0→bull / <0→bear, **二选一无中性**; ofi_n 缺失/为0 用 body 符号兜底并标 `meta.body_fallback`) + **概率 `P(close>open|ofi)`** 三层(经验校准表 Bayesian shrink + flow-gap + 最近60s流) + 三层独立过滤(多周期4h/1h/15m 结构 + 跨资产ETH/SOL 广度 + WS OFI 新鲜度反转保护) + 9路并行HTTP
  - ⚠️ **K 线开局阶段概率不可信**(已知问题,见 [pitfalls](references/pitfalls.md)):主源 `ofi_n = 2*(tb/v)−1` 取自**当前进行中**的 K 线,`_ofi_native()` 只挡 `v<=0`、**无最小样本量保护** → 开局几秒的少量成交就能把 ofi_n 推到 ±0.9。而 `vol_gate`(L692 按 `MIN_VOL_FRAC=0.25` 判断流量是否够)**算出来但从不参与任何决策**,只是输出里的装饰字段。**建议只在进度 ≥40% 后采信概率/下单**
  - 门限: `T_OFI_GATE=0.20` / `T_OFI_60=0.35` / WS 质量闸 `OFI_CR_MIN=0.80` / `OFI_BAYES_N=30`
  - **13 因子仍计算并输出**(JSON 契约保留), 但自 v6.0 起**不参与 bias 决策** — score 只用于 `strength` 标签与 LLM 参考
- **订单流** `scripts/ofi_feed.py`: trade+bookTicker 组合流 tick规则推断主动买卖, 写 `~/bb-auto/ofi.json`, 带 ts 保鲜(>30s 引擎降级为只信 REST 主源) (launchd: com.daniel.ofi-feed)
- **日志** `5minbtc-log.py`: jsonl 追加 + 增量 settle (写入 logs/)
- **新闻** `5minbtc-news.py`: CoinDesk RSS (唯一稳定源, ~14min 延迟)
- **常驻进程** (launchd): `5minbtc_realtime.py` (5s 刷新, 预测快照+EV下单) / `5minbtc_watch.py` / `5minbtc_trader.py --paper-monitor`
- **LLM**: 因子打分基准 + LLM 综合裁决 + 模板输出

## 铁律
1. 每次必须重新执行引擎脚本 — 不缓存
2. 每次必须重新搜索3组新闻
3. 先 settle 上一根, 再 log 新预测
4. LLM 可微调引擎的 `pred_close`/range, 但必须说明理由
   ⚠️ **bias 不要轻易覆盖** (v6.0): 方向是 OFI 一票决定的, LLM 用因子/新闻翻方向 = 退回被证伪的路径。
   仅在 `meta.body_fallback=True` 或 OFI 数据缺失时才允许改 bias, 并显式写明原因。
5. 输出 15-25 行 (平衡深度和 Telegram 可读性)

## 关键裁决规则 (⚠️ 历史规则: v5.7.x 因子打分路径)

> **v6.0 起 bias 由真 OFI 一票决定, 下列规则不再决定方向。** 仅在两条兜底路径上仍有参考价值:
> ① `meta.body_fallback=True` (ofi_n 缺失/为0, 方向退回 body 符号) ② LLM 复核时解释 `meta` 冲突字段。
> 引擎的 `raw score` 仍输出, 但只影响 `strength` 标签, 不影响 bias。

- **half_body vs imbalance 冲突** (v5.7.2): |half_body|>0.25 + |imbalance|>0.5 + progress≥45% → 优先 half_body <sub>(注: 两者自 v5.9 起权重已清零)</sub>
- **TREND 强趋势 decel 约束** (v5.7.4): EMA delta>$100 时 |decel|>0.7 需 |half_body|>0.15 同向确认
- **fatigue≥0.8**: conf 上限 40, 反向 +10pp
- **chainlink_offset 矛盾**: bias=bull 但 pred_close<current → 以 current 为锚 ±ATR×0.3
- **极端进度 (>80%)**: pred_close 按剩余时间比例缩放
- **Body=0 持续模式**: pred_close → current ± ATR×0.2, conf 降至 35-42%

## 性能快照 (2026-09-10 更新)

> 数字口径以 [对抗式审查报告](references/strategy-adversarial-review.md) 为准 — 旧数字多数含前视偏差。

- **v5.7 回测 71.2% 含前视偏差**(文件里自己标注"已知"); 零前视 v5.8: 前2根1min=**61.4%**, 前4根=69.5%
- 但 61–70% 是"看着 K 线走完再确认"的延续性, **不是 alpha** — 做市商已把它定价进 token 价
- 去掉水分后的真实基准: non-neutral 方向 **57.7%** | bull **63.9%** (唯一显著) | **bear 50.0% = 纯硬币**
- paper 交易: 全样本 UP 成交 **44%** (+$0.24) | 甜区 UP ask 0.40–0.50 → **60%** (+$1.39) ← 唯一正 EV 区间
- **结论: edge 不在方向准不准, 在 `EV = p − P − 成本 > 0`。v6.0 的错价检测(flow-gap)就是直接做这件事。**
- 当前 LLM: `zai/glm-5.2` (8-15s/次) | opencaio 实测 MiniMax-M3 ~2.7s 可作更快选项

## 📚 引用索引 (references/)

### 核心方法论
- [strategy-adversarial-review.md](references/strategy-adversarial-review.md) — **对抗式审查报告: 第一性原理 + 13因子证伪 + 该留/删/缺失 + P0/P1/P2行动清单** (v5.9 依据)
- [lessons.md](references/lessons.md) — **25 条核心教训** (必读, 含 2026-07-05 新增 23-25)
- [pitfalls.md](references/pitfalls.md) — **20 条 pitfalls 集中索引** (必读, 含并行 max() 评估陷阱; #18 = K线开局概率不可信; #19 = "真OFI" 只覆盖单一市场; #20 = 端点故障致静默断档)
- [changelog.md](references/changelog.md) — v5.0 ~ v6.0 详细变更
- [skill-organization.md](references/skill-organization.md) — **Skill 文件结构模式 (可复用)** — SKILL.md INDEX + references/ 分专题

From aAAaqwq/AGI-Super-Team, MIT.

More from aAAaqwq/AGI-Super-Team

Signals

Stars
111
Forks
25
Open issues
1
Last commit (this folder)
Oct 20, 2026 (7 days ago)
Last release
Sep 20, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from aAAaqwq

Cite this page

5minbtc skill. Agent Mart. https://agentmart.dev/skills/aaaaqwq-5minbtc (last updated 2026-10-24)