← 返回 Skills 市场
qianzhentao1

Btc Strategy V40

作者 qianzhentao1 · GitHub ↗ · v4.0.1 · MIT-0
cross-platform ⚠ suspicious
81
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install btc-strategy-v40
功能描述
BTC V4.0 量化交易策略 - 基于 EMA3/EMA8 交叉、RSI 和动量的多因子信号系统。 通过 Agent Trade Kit 自动执行 BTC-USDT-SWAP 永续合约交易。
使用说明 (SKILL.md)

多信号融合 BTC 趋势策略 V4.0

策略名称

多信号融合 BTC 趋势策略 V4.0

执行节奏

每 5 分钟触发一次

Step 1 · 行情数据采集

调用 market_get_candles 获取 BTC-USDT-SWAP 的 5m K线数据,计算以下指标:

  • EMA3: 快速指数移动平均线
  • EMA8: 慢速指数移动平均线
  • RSI (14): 相对强弱指数
  • ATR (14): 平均真实波幅
  • 价格动量: (当前价 - 5周期前价格) / 5周期前价格 × 100%

Step 2 · 市场情绪采集

调用以下接口获取市场状态:

  • market_get_funding_rate: 获取 BTC-USDT-SWAP 资金费率
  • market_get_open_interest: 获取持仓量变化
  • market_get_long_short_ratio: 获取多空比

Step 3 · AI 综合判断(核心)

基于以上数据,AI 需要进行以下推理:

1. 趋势判断

  • EMA3 > EMA8 且 EMA3 向上 → bullish 信号 (+2分)
  • EMA3 \x3C EMA8 且 EMA3 向下 → bearish 信号 (-2分)
  • EMA3 与 EMA8 纠缠 → neutral (0分)

2. RSI 判断

  • RSI \x3C 35 → 超卖,做多信号 (+1分)
  • RSI > 65 → 超买,做空信号 (-1分)
  • 35 ≤ RSI ≤ 65 → 中性 (0分)

3. 动量判断

  • 动量 > 1.5% → 强势上涨 (+1.5分)
  • 动量 \x3C -1.5% → 强势下跌 (-1.5分)
  • -1.5% ≤ 动量 ≤ 1.5% → 震荡 (0分)

4. 资金费率检查

  • 资金费率 > 0.1% → 多头过度拥挤,降低做多仓位 50%
  • 资金费率 \x3C -0.1% → 空头过度拥挤,降低做空仓位 50%

5. ATR 风险评估

  • ATR > 近期均值 × 1.5 → 波动过大,降低仓位或跳过
  • ATR \x3C 近期均值 × 0.5 → 波动过小,降低仓位或跳过

最终决策逻辑

加权评分 = 趋势分 + RSI分 + 动量分

总分 决策 仓位比例
≥ 3 开多 80%
1.5 ~ 3 开多 50%
-1.5 ~ 1.5 观望 0%
-3 ~ -1.5 开空 50%
≤ -3 开空 80%

AI 必须给出明确的决策理由,例如:

  • "EMA3/8金叉 + RSI超卖 + 动量强劲,综合评分3.5,建议开多80%仓位"
  • "资金费率过高,虽然趋势看多但降低仓位至40%"

Step 4 · 执行下单(仅当 AI 判断明确开仓时)

调用 swap_place_order

instId = "BTC-USDT-SWAP"
side = \x3CAI判断的方向,buy/sell>
ordType = "market"
sz = \x3C按账户净值和仓位比例计算>
posSide = \x3Clong/short>
tag = "agentTradeKit"  // 必填,否则不计入排行榜

仓位计算公式

仓位大小 = 账户净值 × 仓位比例 × (1 / 当前价格) × 杠杆倍数
最大杠杆:10x

Step 5 · 止损设置

开仓后立即调用 swap_place_algo_order 设置止损:

多头止损

  • 止损价 = 开仓价 × 0.97 (3%止损)
  • 或:开仓价 - 2 × ATR

空头止损

  • 止损价 = 开仓价 × 1.03 (3%止损)
  • 或:开仓价 + 2 × ATR

风控规则

// 单笔最大亏损不超过账户净值 3%
// 当日净值回撤超 8% 则停止新开仓
// 最多同时持有 1 个标的(BTC)
// 禁止对冲持仓(不能同时持有多空仓位)
// 每次触发只执行一个方向的订单
// 已有持仓时,同方向信号加仓,反方向信号平仓并反向开仓

策略特点

  1. 多因子融合: EMA趋势 + RSI超买超卖 + 动量确认
  2. 动态仓位: 根据信号强度调整仓位大小
  3. 风险可控: 严格的止损和回撤控制
  4. 自适应: 根据市场波动率(ATR)调整策略

参数配置

参数 说明
EMA短周期 3 快速EMA
EMA长周期 8 慢速EMA
RSI周期 14 标准RSI
RSI做多阈值 35 超卖区间
RSI做空阈值 65 超买区间
动量阈值 ±1.5% 动能确认
检查频率 5分钟 执行节奏
最大杠杆 10x 杠杆上限
止损比例 3% 固定止损
日回撤限制 8% 风控线
安全使用建议
This skill is suspicious because its code files do things not described in SKILL.md and it expects local credentials/config that are not declared. Before installing or running it: 1) Do not run on a machine that holds real exchange API keys or irreplaceable data. 2) Inspect the full Python and shell scripts locally (you already have them) and search for any hardcoded endpoints or tokens. 3) If you want notifications, note the script reads a Telegram bot token from $HOME/.config/trading_bot/telegram_token and posts to a hardcoded chat_id — ensure you control that token and chat. 4) The scripts call the 'okx' CLI and public exchange APIs; ensure you understand which credentials are used by the OKX CLI and whether they are present. 5) Prefer running in a sandbox or VM and use testnet/demo accounts; remove or replace automatic network/posting behavior until you explicitly configure it. 6) Ask the author to (a) declare required binaries and env vars, (b) remove or explicitly document reading from HOME paths, (c) avoid hardcoded chat IDs, and (d) make external calls and credential use explicit. Because the mismatch could be sloppy engineering or intentional obfuscation, exercise caution and confirm expected behaviors before giving the skill access to real funds or credentials.
功能分析
Type: OpenClaw Skill Name: btc-strategy-v40 Version: 4.0.1 The bundle is classified as suspicious primarily due to a hardcoded Telegram CHAT_ID (5876347015) in 'scripts/btc_signal_monitor_v40_fixed.sh'. This configuration causes the script to exfiltrate real-time trading activity, including entry prices and PNL data, to the author's Telegram account if a bot token is configured. Additionally, the scripts use 'osascript' for macOS-specific notifications and 'os.system' for command execution, while making fragile assumptions about the user's environment (e.g., expecting files on the Desktop), which are atypical for a portable skill bundle.
能力标签
crypto
能力评估
Purpose & Capability
SKILL.md describes using agent primitives like market_get_candles and swap_place_order (Agent Trade Kit). The shipped scripts, however, call the OKX CLI, curl to public exchange APIs, and expect local files under $HOME (e.g. $HOME/.config/trading_bot/telegram_token). The metadata declares no required binaries, env vars, or config paths, so the code's actual dependencies (okx CLI, curl, python3, bc, awk, network access, and local token file) are not reflected — this mismatch is unexpected for a trading strategy that claims to operate via the agent API.
Instruction Scope
SKILL.md limits runtime actions to fetching market data and placing swap orders via agent APIs and requires the AI to reason and then call swap_place_order. The runtime files instead: run a local Python script that invokes the 'okx' CLI and prints/writes signals, and a bash monitor that runs every minute, writes logs/state under $HOME, reads a Telegram token file, and sends messages to a hardcoded Telegram chat via api.telegram.org. The scripts read/write local state files (/tmp/btc_signal.txt, $HOME/.okx_data/, state file) and call third-party APIs — none of these behaviors are mentioned in SKILL.md and they expand the scope beyond what the description suggests.
Install Mechanism
There is no install spec (instruction-only). However, the skill bundle includes executable scripts that will run from disk. Although no external download/install occurs at install time, the presence of these scripts means local execution will depend on system binaries and network access. No high-risk download URLs were found, but the lack of an install manifest means the agent/user may not be warned about required binaries.
Credentials
The skill metadata declares no required env vars or credentials, yet the bash script attempts to read a Telegram bot token from $HOME/.config/trading_bot/telegram_token and uses a hardcoded Telegram chat_id. The Python script invokes the 'okx' CLI (which typically requires OKX credentials/config) and the shell script will call exchange APIs and may rely on local CLI credentials. Reading unstated local config paths and relying on locally-stored credentials without declaring them is disproportionate and opaque.
Persistence & Privilege
The scripts create and write persistent files under the user's home ($HOME/.okx_data/signal_monitor_v40_fixed.log, trading_state_v40.txt) and use /tmp/btc_signal.txt. They do not request always:true nor modify other skills' configs, but they do establish long-running behavior (an infinite loop in the bash monitor) and persistent state on disk, which is notable and should be reviewed before running.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install btc-strategy-v40
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /btc-strategy-v40 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v4.0.1
- 联合 Agent Trade Kit,实现 BTC-USDT-SWAP 永续合约自动化交易执行 - 策略决策流程优化:明确分五步,包括行情数据采集、市场情绪分析、AI 多因子推理、自动下单与风控 - 新增市场情绪数据输入(资金费率/持仓量/多空比),并纳入仓位与风险判断 - 信号评分和决策标准更详细,动态调整仓位比例,添加严格止损与回撤风控规则 - 每 5 分钟执行周期,增强与 OKX 竞赛排行榜兼容性
v4.0.0
BTC quantitative trading strategy major update: introduces multi-factor signal system and automation. - Added multi-factor signal system using EMA3/EMA8 cross, RSI, and momentum, each with custom weight. - New real-time price monitoring and technical signal notifications via Telegram Bot. - Supports BTC perpetual contracts with dynamic position sizing and 10x leverage, includes detailed risk management. - Provides user scripts for signal monitoring and strategy analysis. - Enhanced monitoring reliability with backup price sources and automatic logging. - Detailed configuration and parameter documentation added.
元数据
Slug btc-strategy-v40
版本 4.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Btc Strategy V40 是什么?

BTC V4.0 量化交易策略 - 基于 EMA3/EMA8 交叉、RSI 和动量的多因子信号系统。 通过 Agent Trade Kit 自动执行 BTC-USDT-SWAP 永续合约交易。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 81 次。

如何安装 Btc Strategy V40?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install btc-strategy-v40」即可一键安装,无需额外配置。

Btc Strategy V40 是免费的吗?

是的,Btc Strategy V40 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Btc Strategy V40 支持哪些平台?

Btc Strategy V40 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Btc Strategy V40?

由 qianzhentao1(@qianzhentao1)开发并维护,当前版本 v4.0.1。

💬 留言讨论