返回顶部
s

strategy-engine" 策略引擎

调用Strategy Engine MCP服务器执行量化策略。当用户需要运行因子表达式策略、回测交易策略或执行金融分析时调用此技能。基于MCP Server工具的实际默认值设置。"

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
91
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

strategy-engine"

Strategy Engine MCP服务器调用指南 v2.9

🎯 快速调用

当用户提供策略条件时,基于MCP Server工具的实际默认值自动组合参数:

python

自动组合参数示例(基于MCP Server工具实际默认值)


mcpenginemcpserverrunexpressionselected(
input={
startDate: 2024-01-17, # 开始日期,DateTime类型
endDate: 2024-04-17, # 结束日期,DateTime类型
period: 5m, # 基础周期(默认:5m)
codes: , # 合约代码列表(新增字段,默认:空)
poolId: 10, # 期货加权品种池(默认:10)
openCondition: 用户提供的开仓条件,
closeCondition: 用户提供的平仓条件,
stopCondition: 用户提供的止损条件,
initCash: 10000000, # 初始资金(默认:10000000)
direction: 1, # 多头方向(默认:1)
commssionFee: 0, # 手续费%(默认:0,不需要手续费)
slippage: 0, # 跳数或跳点值(默认:0,按最小变动价格计算)
runId: 123456789 # 运行ID(默认:随机生成一串长整型数字)
}
)

📋 参数说明(基于MCP Server工具实际默认值)

主要参数结构
参数类型说明实际默认值示例
inputExpressionSelectedV2Input输入参数对象-{...}

ExpressionSelectedV2Input对象属性
属性类型说明实际默认值示例
startDateDateTime开始日期当前日期-3个月2024-01-17
endDate
DateTime | 结束日期 | 当前日期 | 2024-04-17 |

| period | string | 基础周期 | 5m(5分钟) | 1d, 60m | | codes | string | 合约代码列表(新增) | 空字符串 | IF2404,IC2404 | | poolId | int | 品种池ID | 10(期货加权) | 4(股票池) | | openCondition | string | 开仓条件 | 用户提供 | ma5m30trend == 1 | | closeCondition | string | 平仓条件 | 用户提供 | ma5m30trend == -1 | | stopCondition | string | 止损条件 | 用户提供 | _palp > 10 | | initCash | float | 初始资金 | 10000000 | 500000 | | direction | int | 交易方向 | 1(多头) | 0(空头) | | commssionFee | float | 手续费% | 0(不需要手续费) | -1(按系统设置手续费参与计算) | | slippage | float | 跳数或跳点值 | 0(按最小变动价格计算) | 1(1个跳点) | | runId | long | 运行ID | 随机生成一串长整型数字 | 123456789 |

手续费参数说明
说明适用场景
0不需要手续费默认值,测试策略时使用
-1
按系统设置手续费参与计算 | 使用系统配置的手续费 |

| >0 | 按设置的手续费计算 | 自定义手续费率 |

滑点参数说明
说明适用场景
0无滑点默认值,理想交易环境
>0
按设置的跳点值计算 | 模拟真实交易环境 |

合约代码参数说明(新增)
说明适用场景
空字符串使用品种池进行回测默认值,使用poolId指定的品种池
具体合约代码
指定具体合约进行回测 | 如IF2404,IC2404,多个合约以逗号分隔 |

合约代码与品种池关系
情况codes值poolId值说明
使用品种池>0默认情况,使用poolId指定的品种池
使用具体合约
非空 | 0 | 系统自动将poolId置为0,使用指定合约 |

| 无效配置 | 空 | 0 | 错误:必须提供合约代码或有效品种池 |

运行ID参数说明
说明适用场景
随机长整型数字每次运行可随机生成一串长整型数字用于标识每次策略运行的唯一ID

完整周期参数映射
周期说明适用策略默认值
1m1分钟高频交易-
5m
5分钟 | 短线交易 | ✅ |

| 15m | 15分钟 | 中短线策略 | - | | 30m | 30分钟 | 中短线策略 | - | | 60m | 1小时或60分钟 | 短期趋势 | - | | 1d | 1日或日线或天 | 中长线策略 | - | | 1w | 1周或周 | 长期投资 | - | | 1mon | 1月或月 | 长期投资 | - |

品种池映射
poolId说明适用市场默认值
10期货加权品种池期货市场
4
股票品种池 | 股票市场 | - |

| 6 | ETF品种池 | ETF市场 | - |

🔧 智能参数推断逻辑(重要)

基础周期推断规则(关键区别)

python

重要概念区分:

1. 基础周期(period):K线数据的周期(5m、30m、1d等)

2. 均线周期:技术指标的计算周期(30、60、120等)

规则1:用户明确指定基础周期时,使用用户指定的周期

if 基础周期 in userinput or K线周期 in userinput or 数据周期 in user_input: if 30分钟 in user_input: period = 30m elif 60分钟 in userinput or 1小时 in userinput: period = 60m elif 5分钟 in user_input: period = 5m elif 15分钟 in user_input: period = 15m elif 日 in userinput or 天 in userinput: period = 1d elif 周 in user_input: period = 1w elif 月 in user_input: period = 1mon else: # 规则2:用户未明确指定基础周期时,使用默认周期5m # 注意:用户提到30分钟均线指的是均线周期,不是基础周期! period = 5m # 默认值

均线周期识别规则

python

识别用户提到的均线周期(用于构建FactorLang表达式)

if 30分钟均线 in user_input: # 用户提到的是均线周期30,基础周期仍然是5m ma_period = 5m # 基础周期 ma_length = 30 # 均线长度 elif 60分钟均线 in user_input: ma_period = 5m # 基础周期 ma_length = 60 # 均线长度 elif 120分钟均线 in user_input

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 strategy-engine-1775986878 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 strategy-engine-1775986878 技能

通过命令行安装

skillhub install strategy-engine-1775986878

下载

⬇ 下载 strategy-engine" v1.0.0(免费)

文件大小: 5.21 KB | 发布时间: 2026-4-13 12:11

v1.0.0 最新 2026-4-13 12:11
Initial release of strategy-engine.

- Provides a unified interface to execute quantitative strategies via the MCP Server.
- Supports automatic parameter assembly using real MCP Server defaults.
- Adds detailed parameter descriptions and intelligent inference rules for period, stock pool, time range, and stop-loss logic.
- Introduces support for specifying either contract codes or instrument pools, including coexistence logic.
- Includes examples and smart inference mechanisms for user-friendly strategy invocation.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部