Vynn 回测引擎:Openclaw Skills 的交易策略分析工具

作者:互联网

2026-03-30

AI教程

什么是 Vynn 回测引擎?

Vynn 回测引擎是 Openclaw Skills 生态系统中的专用工具,旨在弥合复杂量化分析与自然语言之间的鸿沟。它允许用户用普通英语或结构化 JSON 描述交易策略,并立即获得专业级的绩效指标。通过利用高性能量化引擎,该技能消除了管理本地数据馈送或编写复杂回测样板代码的麻烦。

作为更广泛的 Openclaw Skills 套件的一部分,Vynn 回测引擎提供了一个精简的界面,用于测试股票、ETF 和指数的 Alpha。无论您是在验证简单的 RSI 均值回归,还是复杂的基于动量的投资组合,该技能都能提供可操作的见解,如夏普比率、最大回撤和完整的权益曲线,且无需任何本地基础设施。

下载入口:https://github.com/openclaw/skills/tree/main/skills/beee003/vynn-backtester

安装与下载

1. ClawHub CLI

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

npx clawhub@latest install vynn-backtester

2. 手动安装

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

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

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

3. 提示词安装

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

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

Vynn 回测引擎 应用场景

  • 使用自然语言对 RSI 或布林带等均值回归策略进行回测。
  • 同时验证跨多个股票代码的动量策略。
  • 直接对比不同技术指标的性能,以寻找最佳夏普比率。
  • 使用 JSON 开发和测试结构化交易逻辑,以实现精确的进场和离场执行。
Vynn 回测引擎 工作原理
  1. 用户向 Openclaw Skills 智能体提供策略描述或 JSON 规则。
  2. 该技能为 Vynn API 封装策略、股票列表和回溯期。
  3. Vynn 量化引擎在服务器端根据历史市场数据处理回测。
  4. 计算核心财务指标,包括夏普比率、总回报率和最大回撤。
  5. 最终结果将返回并在 Openclaw Skills 界面内为用户进行格式化。

Vynn 回测引擎 配置指南

要开始在 Openclaw Skills 环境中使用此功能,请遵循以下步骤:

  1. 从 the-vynn.com 获取 API 密钥。
  2. 设置 VYNN_API_KEY 环境变量。
# 通过 CLI 注册以获取您的 API 密钥
curl -X POST https://the-vynn.com/v1/signup -H "Content-Type: application/json" -d '{"email": "your-email@example.com"}'

# 配置您的环境
export VYNN_API_KEY="your_vynn_key_here"

Vynn 回测引擎 数据架构与分类体系

该技能返回如下组织的结构化财务数据:

指标 类型 描述
sharpe_ratio 浮点数 风险调整后的收益指标
total_return_pct 浮点数 累计百分比收益或损失
max_drawdown 浮点数 最大峰谷跌幅百分比
win_rate 浮点数 盈利交易百分比
trade_count 整数 执行的交易总数
equity_curve 列表 代表投资组合价值随时间变化的时间序列数据
name: vynn-backtester
description: Run trading strategy backtests with natural language — powered by Vynn
version: 1.0.0
homepage: https://the-vynn.com
metadata:
  clawdbot:
    emoji: "??"
    requires:
      env: ["VYNN_API_KEY"]
    primaryEnv: "VYNN_API_KEY"
    files: ["plugin.py", "config.example.toml"]
tags: [backtest, trading, quant, finance, strategy, stocks, portfolio, alpha]

Vynn Backtester

Backtest any trading strategy with natural language. Get Sharpe ratio, returns, drawdown, and full equity curves in seconds.

What it does

  • Natural language strategies: Describe your strategy in plain English and Vynn translates it into a runnable backtest
  • Structured strategies: Power users can pass precise entry/exit rules as JSON
  • Full metrics: Sharpe ratio, total return, max drawdown, win rate, trade count, and equity curve
  • Multi-ticker: Backtest across any combination of stocks, ETFs, or indices
  • Strategy comparison: Compare multiple strategies head-to-head, ranked by Sharpe ratio
  • No infrastructure: No local data downloads, no dependencies beyond Python stdlib

Setup

  1. Get a free API key at the-vynn.com (10 backtests/month, no credit card)
  2. Set VYNN_API_KEY in your environment or skill config
  3. Run /backtest "your strategy here" from any OpenClaw agent

Quick start

# Sign up (instant, returns your API key)
curl -X POST https://the-vynn.com/v1/signup -H "Content-Type: application/json" -d '{"email": "you@example.com"}'

# Set the key
export VYNN_API_KEY="vynn_free_..."

Usage examples

Simple natural language backtest

/backtest "RSI mean reversion on AAPL, 2 year lookback"

Momentum strategy

/backtest "MACD crossover on SPY with 20/50 EMA filter"

Multi-ticker portfolio

/backtest --tickers AAPL,MSFT,GOOGL --strategy "momentum top 3"

Structured entry/exit rules

/backtest '{"entries": [{"indicator": "RSI", "op": "<", "value": 30}], "exits": [{"indicator": "RSI", "op": ">", "value": 70}]}' --tickers AAPL

Compare strategies

from plugin import VynnBacktesterPlugin

vynn = VynnBacktesterPlugin()
results = vynn.compare(
    strategies=[
        "RSI mean reversion",
        "MACD crossover",
        "Bollinger band breakout",
    ],
    tickers=["SPY"],
)
for r in results:
    print(f"{r.strategy}: Sharpe={r.sharpe_ratio}, Return={r.total_return_pct}%")

Environment Variables

Variable Required Description Default
VYNN_API_KEY Yes Your API key from the-vynn.com --
VYNN_BASE_URL No Override API base URL (for self-hosted instances) https://the-vynn.com/v1

External Endpoints

Endpoint Purpose Data Sent
https://the-vynn.com/v1/backtest Execute a strategy backtest Strategy text, ticker list, lookback period
https://the-vynn.com/v1/signup Free API key registration Email address

Security & Privacy

  • All requests authenticated via X-API-Key header
  • Strategy descriptions and ticker lists are sent to the Vynn API for backtest execution
  • No trading data, portfolio holdings, or personal information is stored beyond the backtest run
  • Backtest results are ephemeral and not persisted on Vynn servers
  • No credentials are stored by the skill -- only your API key in environment variables
  • Source code is fully open: github.com/beee003/astrai-openclaw

Model Invocation

This skill does not invoke any LLM models. It sends strategy descriptions to the Vynn backtest engine, which is a quantitative execution engine (not an AI model). No prompts or completions are generated.

Pricing

  • Free: 10 backtests/month, all features, no credit card required
  • Pro ($29/mo): Unlimited backtests, priority execution, extended lookback periods