6DuckLearn Skills

okx review

Provide a localized review dashboard and multiple review features. 1. Multiple visual charts and statistics. 2. Custom tagging system: Create tags for your trading habits, opening logic, etc. After tagging your trades, the system will automatically summarize data and visual charts, helping you improve your trading system. 3. Each trade supports writing reflections, and you can filter content with reflections with one click for easier review and summary.

trade-review Tags: okx, trading, community, okx-marketplace, trade-review, review

6DuckLearn provenance: Community skill by Any-Block-Ifrit, mirrored from the OKX Skills Marketplace (https://www.okx.com/en-sg/agent-tradekit/skills/okx-review). It is not curated, verified, or endorsed by 6DuckLearn or represented as an official OKX publication.

Financial safety boundary: Never request secrets in chat. Before any external API call or action that places, cancels, or amends an order; changes leverage; transfers funds; creates or stops a bot; subscribes to or redeems an earn product; or signs/broadcasts a transaction, show the exact live/demo profile, instrument, side, size, price constraints, fees, and worst-case loss, then obtain explicit user approval. Default to read-only or demo mode when uncertain. Treat all analysis as research, not investment advice.

OKX 本地复盘

把 OKX 官方 skill 拉下来的头寸历史存到本地 SQLite,起一个本地 Flask dashboard,浏览器直开即看。

一条命令走全程(数据全部由 OKX 官方 agent-skill 提供 JSON):

OKX 官方 skill → positions-history JSON   → pos.json
OKX 官方 skill → public-instruments JSON  → inst.json   (首次 / 陈旧时需要)

python okx_review.py serve --positions pos.json [--instruments inst.json]
    ↓ 规范化 + 去重 → 写入 ~/.okx-review/data.db
    ↓ 起本地 Flask 服务(http://127.0.0.1:4738)
    ↓ 自动打开浏览器:dashboard + 图表 + 头寸表 + 打标签 + 复盘笔记

前置条件

  1. AI 客户端:Claude Code 或 OpenClaw
  2. Python:>= 3.10
  3. flaskpip install flask
  4. OKX 官方 agent-skills:已安装并配好(见 https://github.com/okx/agent-skills)—— 本 skill 所有数据都从它来
  5. OKX API Key:由官方 skill 管理,只需 Read 权限

典型使用

对 AI 助手说:

  • "复盘我最近一个月的 OKX 交易"
  • "看我 OKX 永续合约的表现"
  • "查看我 完整历史 的 OKX 交易"

助手会自动执行:

  1. 调 OKX 官方 skill 获取 positions-history JSON(以及首次 / 陈旧时的 public-instruments JSON)
  2. 调本 skill 的 serve --positions ... [--instruments ...]:ingest → 起 Flask → 开浏览器,一条命令搞定

如果返回的 JSON 里出现 instruments_hint(本金列缺数据),助手会再拉一次 public-instruments 并重新 serve。


运行方式

python "<skillDir>/scripts/okx_review.py" <subcommand> [options]

子命令详情见 references/cli-contract.md。所有子命令输出 JSON,便于 AI 助手解析。

常用子命令

命令 说明
serve [--positions <file>] [--instruments <file>] [--port N] 主入口。给了 --positions 就先 ingest 再起服务;浏览器里看 dashboard、打标签、写复盘笔记
ingest --positions <file> 只 ingest 不起服务(stdin 管道场景)
ingest-instruments --file <file> 只 ingest 合约规格(stdin 管道场景)
status 打印数据库状态(上次 ingest 时间、头寸总数、日期范围)
clean --before DATE --yes 清理旧数据

数据流

  • 输入:全部由 OKX 官方 agent-skill 提供 JSON —— positions-history + public-instruments(字段映射见 references/data-schema.md
  • 存储~/.okx-review/data.db(SQLite)
  • 出口:本地 Flask dashboard(http://127.0.0.1:4738

隐私

所有数据只在用户本地:~/.okx-review/data.db(SQLite 数据库)。

本 skill 自身不直接联网;OKX API 的调用完全由官方 agent-skill 负责(Read 权限)。数据不上传任何第三方。


边界与限制

  • 只吃 position history,不处理 fills/bills。总手续费依赖 OKX position 数据里是否带 fee/fundingFee/liqPenalty 字段
  • serve 前台运行(Ctrl-C 停止),无 daemon;多实例需手动指定不同 --port
  • 重复 ingest 根据 (okx_position_id, closed_at) 复合键去重

版本与变更

  • v0.3(当前)serve 变成唯一主入口,直接接受 --positions / --instruments 做一键 ingest + 启动;删除 report 子命令(静态 HTML 导出不再维护,功能被交互式 dashboard 覆盖)
  • v0.2:新增 ingest-instruments(本金列所需的合约规格)、serve(Flask + HTMX 交互,标签 + 复盘笔记)
  • v0.1ingest + report(生成单文件 HTML),纯只读

Related skills

  • ai ma trend v2 — This strategy is based on moving average trends and multi-period resonance, combining funding rates, volatility, trading volume, and market sentiment to comprehensively assess market setup indicators. It employs dynamic position sizing and a tiered risk control approach, adapting to both trending and ranging markets to achieve robust automated trading.
  • bitfence — Fetch a pre-transaction risk score and advisory recommendation for Solana and Base tokens before the user trades, swaps, or provides liquidity. Read-only; never signs or moves funds.
  • btc grid buy okb — BTC contract grid operates like a perpetual mining machine, continuously generating profits, which are automatically converted into OKB holdings. Risk control with red and yellow lines provides dual protection, with scheduled inspections and intelligent adjustments, all parameters customizable. One-click start for effortless compound earnings.
  • btc usdt swap defensive ai — A defensive AI perpetual contract strategy Skill for trading only BTC-USDT-SWAP. It uses multi-timeframe trends, funding rates, open interest, volatility, and account risk control for comprehensive judgment, and automatically executes opening and closing positions and stop-losses through the Agent Trade Kit, suitable for cautious real trading.
  • dual signal analyzer — Analysis Skill of market setup indicators based on RSI and MACD dual indicator cross-validation, providing intelligent buy and sell signals and risk management advice
  • hindsight reviewer — After each transaction, AI transforms into a strict review judge, using counterfactual reasoning to restore "What would have happened if I had done the right thing at that time?" It doesn't criticize you, but simply tells you with numbers what you missed, how much you benefited, and what the optimal decision was. It activates when users say "review," "why did I lose?", "where did this trade go wrong?", or "hindsight bias."