加密货币自我学习:AI 交易模式分析 - Openclaw Skills

作者:互联网

2026-03-20

AI教程

什么是 加密货币自我学习?

加密货币自我学习技能是一个专为希望超越手动记录的交易者设计的技术框架。通过将每笔交易视为一个数据点,该技能使 AI 代理能够将入场/出场条件、技术指标和市场情绪记录为结构化格式。这种系统化方法确保了每一次盈利和亏损都能为 Openclaw Skills 生态系统内不断增长的智能库做出贡献。

其核心是利用基于 Python 的分析来寻找特定指标(如 RSI 水平或宏观趋势)与交易成功之间的相关性。它通过自动更新代理记忆中的学习约束,弥合了原始数据与执行之间的鸿沟,从而有效防止重复代价高昂的错误,同时强化高概率的设置。

下载入口:https://github.com/openclaw/skills/tree/main/skills/totaleasy/crypto-self-learning

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install crypto-self-learning

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 crypto-self-learning。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

加密货币自我学习 应用场景

  • 记录带有完整技术背景的交易,包括 RSI、MACD 和市场趋势指标。
  • 识别一周中不同日期或特定杠杆水平下交易表现中的隐藏模式。
  • 自动生成交易规则并将其应用于 AI 代理的记忆,以优化其决策逻辑。
  • 进行每周回顾,以衡量策略随时间推移的改进情况。
加密货币自我学习 工作原理
  1. 用户使用 log_trade.py 脚本记录交易,提供执行详情和技术指标值。
  2. 系统将这些数据存储在结构化 JSON 文件中,以维护所有市场活动的原始记录。
  3. analyze.py 脚本处理历史数据,根据方向、交易对和指标识别统计胜率。
  4. 使用 generate_rules.py 生成可执行规则,将数据模式转化为清晰的“避免”或“偏好”指令。
  5. update_memory.py 脚本将这些数据驱动的规则直接推送到代理的记忆层,用于未来的交易验证。

加密货币自我学习 配置指南

要开始使用此技能,请确保已安装 python3 和 jq。您可以使用以下命令结构记录您的第一笔交易:

python3 scripts/log_trade.py --symbol BTCUSDT --direction LONG --entry 78000 --exit 79500 --pnl_percent 1.92 --result WIN --reason "Support bounce"

要查看您当前的绩效指标,请运行分析脚本:

python3 scripts/analyze.py

加密货币自我学习 数据架构与分类体系

交易在 data/trades.json 文件中管理。每个条目都遵循一个全面的架构,以确保与 Openclaw Skills 分析工具的最大兼容性:

属性 类型 描述
id 字符串 交易记录的唯一 UUID
symbol 字符串 交易对(例如 BTCUSDT)
pnl_percent 浮点数 盈亏百分比
indicators 对象 包含入场时技术状态的嵌套 JSON
market_context 对象 宏观数据,如 BTC 趋势或 DXY 强度
name: crypto-self-learning
description: Self-learning system for crypto trading. Logs trades with full context (indicators, market conditions), analyzes patterns of wins/losses, and auto-updates trading rules. Use to log trades, analyze performance, identify what works/fails, and continuously improve trading accuracy.
metadata: {"openclaw":{"emoji":"??","requires":{"bins":["jq","python3"]}}}

Crypto Self-Learning ??

AI-powered self-improvement system for crypto trading. Learn from every trade to increase accuracy over time.

?? Core Concept

Every trade is a lesson. This skill:

  1. Logs every trade with full context
  2. Analyzes patterns in wins vs losses
  3. Generates rules from real data
  4. Updates memory automatically

?? Log a Trade

After EVERY trade (win or loss), log it:

python3 {baseDir}/scripts/log_trade.py r
  --symbol BTCUSDT r
  --direction LONG r
  --entry 78000 r
  --exit 79500 r
  --pnl_percent 1.92 r
  --leverage 5 r
  --reason "RSI oversold + support bounce" r
  --indicators '{"rsi": 28, "macd": "bullish_cross", "ma_position": "above_50"}' r
  --market_context '{"btc_trend": "up", "dxy": 104.5, "russell": "up", "day": "tuesday", "hour": 14}' r
  --result WIN r
  --notes "Clean setup, followed the plan"

Required Fields:

Field Description Example
--symbol Trading pair BTCUSDT
--direction LONG or SHORT LONG
--entry Entry price 78000
--exit Exit price 79500
--pnl_percent Profit/Loss % 1.92 or -2.5
--result WIN or LOSS WIN
Field Description
--leverage Leverage used
--reason Why you entered
--indicators JSON with indicators at entry
--market_context JSON with macro conditions
--notes Post-trade observations

?? Analyze Performance

Run analysis to discover patterns:

python3 {baseDir}/scripts/analyze.py

Outputs:

  • Win rate by direction (LONG vs SHORT)
  • Win rate by day of week
  • Win rate by RSI ranges
  • Win rate by leverage
  • Best/worst setups identified
  • Suggested rules

Analyze Specific Filters:

python3 {baseDir}/scripts/analyze.py --symbol BTCUSDT
python3 {baseDir}/scripts/analyze.py --direction LONG
python3 {baseDir}/scripts/analyze.py --min-trades 10

?? Generate Rules

Extract actionable rules from your trade history:

python3 {baseDir}/scripts/generate_rules.py

This analyzes patterns and outputs rules like:

?? AVOID: LONG when RSI > 70 (win rate: 23%, n=13)
? PREFER: SHORT on Mondays (win rate: 78%, n=9)
?? CAUTION: Trades with leverage > 10x (win rate: 35%, n=20)

?? Auto-Update Memory

Apply learned rules to agent memory:

python3 {baseDir}/scripts/update_memory.py --memory-path /path/to/MEMORY.md

This appends a "## ?? Learned Rules" section with data-driven insights.

Dry Run (preview changes):

python3 {baseDir}/scripts/update_memory.py --memory-path /path/to/MEMORY.md --dry-run

?? View Trade History

python3 {baseDir}/scripts/log_trade.py --list
python3 {baseDir}/scripts/log_trade.py --list --last 10
python3 {baseDir}/scripts/log_trade.py --stats

?? Weekly Review

Run weekly to see progress:

python3 {baseDir}/scripts/weekly_review.py

Generates:

  • This week's performance vs last week
  • New patterns discovered
  • Rules that worked/failed
  • Recommendations for next week

?? Data Storage

Trades are stored in {baseDir}/data/trades.json:

{
  "trades": [
    {
      "id": "uuid",
      "timestamp": "2026-02-02T13:00:00Z",
      "symbol": "BTCUSDT",
      "direction": "LONG",
      "entry": 78000,
      "exit": 79500,
      "pnl_percent": 1.92,
      "result": "WIN",
      "indicators": {...},
      "market_context": {...}
    }
  ]
}

?? Best Practices

  1. Log EVERY trade - Wins AND losses
  2. Be honest - Don't skip bad trades
  3. Add context - More data = better patterns
  4. Review weekly - Patterns emerge over time
  5. Trust the data - If data says avoid something, AVOID IT

?? Integration with tess-cripto

Add to tess-cripto's workflow:

  1. Before trade: Check rules in MEMORY.md
  2. After trade: Log with full context
  3. Weekly: Run analysis and update memory

Skill by Total Easy Software - Learn from every trade ????