← 返回
内容创作 中文

Trading DevBox

Trading strategy development sandbox. User describes trading intent in natural language, agent writes a Python backtest strategy and returns results.
交易策略开发沙盒。用户用自然语言描述交易意图,智能体编写Python回测策略并返回结果。
uu-z
内容创作 clawhub v0.1.0 1 版本 99427.2 Key: 无需
★ 0
Stars
📥 3,645
下载
💾 63
安装
1
版本
#latest

概述

Trading DevBox

Help users develop and backtest trading strategies from natural language descriptions.

When to Use

  • User describes a trading idea or intent (e.g. "SOL 跌 10% 买入,涨 30% 止盈")
  • User asks to write, backtest, or optimize a trading strategy
  • User mentions keywords: 策略, 回测, backtest, strategy, trading

Workflow

  1. Parse the user's trading intent into structured parameters:
    • Asset (e.g. SOL, BTC, ETH)
    • Entry condition (e.g. price drops 10%)
    • Exit condition (e.g. take profit at 30%, stop loss at 5%)
    • Timeframe (e.g. 1h, 4h, 1d)
  1. Confirm the parsed parameters with the user before proceeding.
  1. Generate a Python backtest strategy using backtrader:
mkdir -p /tmp/trading-devbox && cat > /tmp/trading-devbox/strategy.py << 'PYEOF'
import backtrader as bt
import sys
import json

class UserStrategy(bt.Strategy):
    params = dict(
        entry_drop_pct=10,
        take_profit_pct=30,
        stop_loss_pct=5,
    )

    def __init__(self):
        self.order = None
        self.buy_price = None

    def next(self):
        if self.order:
            return
        if not self.position:
            # entry: price dropped by entry_drop_pct from recent high
            high = max(self.data.close.get(size=20) or [self.data.close[0]])
            drop = (high - self.data.close[0]) / high * 100
            if drop >= self.p.entry_drop_pct:
                self.order = self.buy()
                self.buy_price = self.data.close[0]
        else:
            pnl = (self.data.close[0] - self.buy_price) / self.buy_price * 100
            if pnl >= self.p.take_profit_pct or pnl <= -self.p.stop_loss_pct:
                self.order = self.sell()

if __name__ == '__main__':
    print(json.dumps({"status": "ok", "message": "Strategy generated"}))
PYEOF
python3 /tmp/trading-devbox/strategy.py
  1. Report the result to the user in a clear format.

Response Format

Always respond in the user's language. Structure the response as:

  • Parsed intent summary
  • Strategy parameters
  • Execution result or next steps

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-29 05:33 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Trading DevBox POC

uu-z
交易策略沙箱——使用自然语言进行策略回测与部署,POC演示使用模拟数据。
★ 0 📥 260
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 294 📥 136,401
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,131