Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

eastmoney skills

妙想提供的股票模拟组合管理系统,支持持仓查询、买卖操作、撤单、委托查询、历史成交查询和资金查询等功能。通过安全认证的API接口实现真实交易体验。

MIT-0 · Free to use, modify, and redistribute. No attribution required.
1 · 370 · 4 current installs · 4 all-time installs
byeastmoney_dev@qqk000
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
Name/description, SKILL.md, and the Python implementation consistently implement a simulated-stock-management client that calls endpoints under MX_API_URL using an MX_APIKEY. However, registry metadata earlier said 'Required env vars: none' while SKILL.md and the code clearly require MX_APIKEY (and optionally MX_API_URL). This metadata mismatch is an incoherence the user should be aware of.
Instruction Scope
SKILL.md instructs only API calls to the simulated-trading endpoints and to store results locally. The instructions and code do not attempt to read unrelated system files or other credentials. Minor issues: an exported-shell example mixes JS/process.env syntax (nonsensical in a shell), and the skill saves raw API responses to disk (OUTPUT_DIR = /root/.openclaw/workspace/mx_data/output), which may persist sensitive account information.
Install Mechanism
This is instruction + a single Python script with a requirements.txt listing only 'requests'. There is no download-from-arbitrary-URL or binary installation specified. Risk from install mechanism is low.
Credentials
The only secret the skill requires is MX_APIKEY (and optional MX_API_URL) which is appropriate for an API client. However, the skill will store API responses and potentially account data on disk unencrypted in a persistent output directory; that is a privacy concern and should be considered when providing credentials.
Persistence & Privilege
always:false (normal). The skill writes persistent files under /root/.openclaw/workspace/mx_data/output; writing to /root assumes high privileges or may fail under non-root. The skill does not request to modify other skills or system-wide configs. Autonomous invocation is allowed by default (normal) — consider this combined with stored data risk.
Scan Findings in Context
[no_static_findings] expected: Static pre-scan reported no findings. The code does use requests and environment MX_APIKEY, which is expected for an API client.
What to consider before installing
Things to check before installing/use: - Confirm you really obtained MX_APIKEY from the listed '妙想Skills' page and that the endpoint domain (default https://mkapi2.dfcfs.com/finskillshub) is trustworthy. - The registry metadata omitted required env vars even though SKILL.md and the script require MX_APIKEY; assume you must provide the API key to use the skill. - The skill saves API responses (possibly including account/portfolio data) unencrypted to /root/.openclaw/workspace/mx_data/output. If that directory is accessible to others or the agent runs as root, sensitive data could be exposed. Consider changing OUTPUT_DIR to a safer location or disallowing persistent storage. - The SKILL.md contains an odd shell export example that mixes JavaScript/process.env syntax; ignore that and set MX_APIKEY in your environment the usual way (e.g., export MX_APIKEY=your_key). - If you want stronger assurance, inspect the full script yourself, run it in an isolated / least-privileged environment (or container), and monitor outgoing network traffic to the MX_API_URL. - Avoid supplying a production/real trading API key if that key can operate on real funds; prefer a dedicated simulator/test key and rotate it after testing. Overall: functionality is coherent with a simulator client, but metadata inconsistency and local storage of API responses are the main reasons to review and sandbox before use.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.4
Download zip
latestvk9710wggr77vhtpzt8jw1wa3qh837def

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

eastmoney_stock_simulator 妙想模拟组合管理 skill

本 Skill 由妙想提供一个股票模拟组合管理系统,支持股票组合持仓查询、买卖操作、撤单、委托查询、历史成交查询和资金查询等功能。通过调用后端模拟组合交易相关原生接口,实现真实的交易体验,所有操作均通过安全认证的 API 接口完成。

tags: ["模拟炒股", "A股", "投资练手", "策略验证"]
use_when:
  - 用户需要模拟炒股练手、验证交易策略
  - 用户需要进行模拟交易操作(买卖/撤单)
  - 用户需要查询模拟账户的持仓、资金、委托、历史成交记录
not_for:
  - 真实资金交易、投资建议生成、交易决策指引
  - 非A股类投资模拟(期货、外汇、港股、美股等)
  - 商业用途、代他人操作、非法交易演示
# 环境变量配置
parameters:
  - name: MX_APIKEY
    description: 妙想Skills页面获取专属API密钥
    required: true
    type: secret
    default: process.env.MX_APIKEY
  - name: MX_API_URL
    description: 模拟交易API基础地址
    required: false
    type: string
    default: process.env.MX_API_URL || "https://mkapi2.dfcfs.com/finskillshub"

功能说明

根据用户问句自动识别意图并调用对应接口,支持以下功能:

  1. 持仓查询:查询指定账户的当前持仓股票。
  2. 买入卖出操作:执行买入和卖出操作,支持限价/市价委托,自动识别市场号和价格小数位。
  3. 撤单操作:撤销指定委托单,也支持一键撤单。
  4. 委托查询:查询账户下的所有委托订单(含已成交、未成交、已撤单)以及账户的历史成交记录。
  5. 资金查询:查询账户可用资金与总资产。

配置

  • MX_APIKEY:妙想Skills页面获取的API密钥,需保密。
  • MX_API_URL:模拟交易API的基础URL,默认为 https://mkapi2.dfcfs.com/finskillshub
  • 默认输出目录: /root/.openclaw/workspace/mx_data/output/(自动创建)
  • 输出文件名前缀: mx_stock_simulator_
  • 输出文件:
    • mx_stock_simulator_{query}.txt - 提取后的纯文本结果
    • mx_stock_simulator_{query}.json - API 原始 JSON 数据

在使用前,请确保已配置以下环境变量:

// 导出API Key和API地址
export MX_APIKEY= ${MX_APIKEY} || process.env.MX_APIKEY
export MX_API_URL= process.env.MX_API_URL || "https://mkapi2.dfcfs.com/finskillshub"

使用方式

  1. 在妙想Skills页面获取apikey。
  2. 将apikey存到环境变量,命名为MX_APIKEY,检查本地apikey是否存在,若存在可直接用。
  3. 使用post请求接口,务必使用post请求,相关接口在后续章节说明。

功能概览

功能模块状态接口路径说明
持仓查询已实现POST /api/claw/mockTrading/positions获取持仓明细、成本、盈亏、总盈亏统计
买入或卖出操作已实现POST /api/claw/mockTrading/trade限价/市价委托,自动识别市场号和价格小数位
撤单操作已实现POST /api/claw/mockTrading/cancel按委托编号撤单或撤销当日所有未成交委托
委托查询已实现POST /api/claw/mockTrading/orders当日/历史委托记录
资金查询已实现POST /api/claw/mockTrading/balance总资产、可用资金、盈亏

股票代码格式说明

买入/卖出/撤单接口的股票代码入参仅支持A股,格式为6位数字,例如 600519000001


前置要求

  • 用户需在妙想Skills页面获取并配置 MX_APIKEYMX_API_URL 环境变量。
  • 模拟组合账户操作前,用户需在妙想Skills页面(地址:https://dl.dfcfs.com/m/itc4 ),创建模拟账户后,并绑定模拟组合。
  • 买入/卖出操作需提供正确的股票代码、价格和数量,且 价格需符合市场规则(如价格小数位)。
  • 撤单操作需提供有效的委托编号,且该委托必须处于可撤销状态。
  • 查询操作需确保账户已绑定且存在有效数据。
  • Header 中必须携带 apikey 进行认证。
apikey: ${MX_APIKEY};

️ 接口说明

  • 所有请求均使用 POST 方法,Content-Type: application/json,并在 Header 中携带 apikey
  • 如果用户无模拟组合账户,需引导用户前往妙想Skills页面(地址:https://dl.dfcfs.com/m/itc4 )进行创建模拟账户并绑定组合后重试。

接口列表

1. 持仓查询

  • 功能:查询指定账户的当前持仓股票。
  • 触发词查询持仓我的持仓持仓情况
  • 请求地址${MX_API_URL}/api/claw/mockTrading/positions
  • 请求体{}
  • 成功响应{ }
curl -X POST "${MX_API_URL}/api/claw/mockTrading/positions" \
  -H "apikey: ${MX_APIKEY}" \
  -H "Content-Type: application/json" \
  -d '{}'

响应示例:

{
  "code": "200",
  "message": "成功",
  "data": {
    "totalAssets": null,
    "availBalance": null,
    "totalPosValue": null,
    "posCount": 0,
    "posList": null,
    "currencyUnit": 1000,
    "totalProfit": 0
  },
  "traceId": null
}

字段说明:

字段类型说明
totalAssetsInt64总资产(厘)
availBalanceInt64可用余额(厘)
totalPosValueInt64总持仓市值(厘)
posListInt32持仓明细数据
posCountInt32持仓股票数量
totalProfitInt64总盈亏(厘)
currencyUnitInt32币种最小面值,1000=厘

持仓列表 posList 元素字段:

字段类型说明
secCodeString证券代码
secMktInt32证券市场号:0=深交所,1=上交所,116=港交所,105=纳斯达克
secNameString证券名称
countInt64持仓数量(股)
availCountInt64可用数量(股)
valueInt64市值(厘)
costPriceInt64成本价(按 costPriceDec 放大为整数,还原:costPrice / 10^costPriceDec)
costPriceDecInt32成本价小数位数
priceInt64现价(按 priceDec 放大为整数,还原:price / 10^priceDec)
priceDecInt32现价小数位数
dayProfitInt64当日盈亏(厘)
dayProfitPctDouble当日盈亏比例%
profitInt64持仓盈亏(厘)
profitPctDouble持仓盈亏比例%
posPctDouble仓位%

2. 买入卖出操作

  • 功能:执行买入操作或卖出操作。
  • 触发词买入买入股票buy卖出卖出股票sell卖出全部sell all一键卖出sell all position卖出持仓sell position卖出当前持仓sell current position卖出所有持仓sell all current position
  • 请求地址${MX_API_URL}/api/claw/mockTrading/trade
  • 请求体{ "type": "buy", "stockCode": "600519", "price": 1780.00, "quantity": 100, "useMarketPrice": false }
  • 成功响应{ "orderId": "ORD987654", "status": "submitted" }
参数必填说明
type操作类型:buy=买入,sell=卖出
stockCode股票代码,自动识别市场号
price委托价格(useMarketPrice=false时必填,支持小数),支持小数
quantity委托数量(股)
useMarketPrice是否以行情最新价买入(默认false),为true时忽略price参数
  • 操作说明:买入/卖出操作需提供正确的股票代码、价格和数量,且价格需符合市场规则(如价格小数位)。当 useMarketPrice=true 时,系统会自动以行情最新价进行买入/卖出。
  • 股票代码格式说明:仅支持A股,格式为6位数字,例如 600519000001,系统会自动识别并补全市场号;另外股票代码必传。
  • 委托数量说明:必须为整数,且需为100的整数倍(如100、200、300等),否则会被交易所拒单。
  • 委托价格说明:当 useMarketPrice=false 时,price参数必填,且需符合市场规则:沪市价格小数位不超过2位,深市价格小数位不超过3位;当 useMarketPrice=true 时,price参数会被忽略,系统会自动以行情最新价进行买入。
curl -X POST "${MX_API_URL}/api/claw/mockTrading/trade" \
  -H "apikey: ${MX_APIKEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "buy",
    "stockCode": "600519",
    "price": 1780.00,
    "quantity": 100,
    "useMarketPrice": false
  }'

响应示例:

{
  "code": "501",
  "message": "买入委托失败: 当前时间不可交易",
  "data": null,
  "traceId": null
}

3. 撤单操作

  • 功能:撤销指定委托单,撤销该账户下所有未成交的委托单。
  • 触发词撤单撤销订单cancel order一键撤单撤销所有订单cancel all撤销当日所有未成交订单撤销所有未成交订单撤销所有订单cancel all pending orders
  • 请求地址${MX_API_URL}/api/claw/mockTrading/cancel
  • 请求体{ "orderId": "ORD987654", "stockCode": "600519" }
  • 成功响应{ }
参数必填说明
type操作类型:order=买入,all=一键撤单
orderId委托编号,type为order时必填
stockCode股票代码,type为order时必填
  • 操作说明:撤单操作需提供有效的委托编号,且该委托必须处于可撤销状态;一键撤单会撤销该账户下所有未成交的委托单。
  • 股票代码格式说明:仅支持A股,格式为6位数字,例如 600519000001,系统会自动识别并补全市场号;另外股票代码在type为order时必传。
curl -X POST "${MX_API_URL}/api/claw/mockTrading/cancel" \
  -H "apikey: ${MX_APIKEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "orderId": "ORD987654",
    "stockCode": "600519"
  }'

响应示例:

{
  "code": "200",
  "message": "成功",
  "data": {
    "rc": 0,
    "rmsg": "没有可撤的委托",
    "cancelCount": 0
  },
  "traceId": null
}

如果部分撤单失败,会返回 failList

{
  "code": "0",
  "data": {
    "rc": 0,
    "rmsg": "一键撤单完成",
    "cancelCount": 2,
    "failCount": 1,
    "failList": [{ "orderID": "20260314003", "rmsg": "撤单失败,已全部成交" }]
  }
}

一键撤单响应字段说明:

字段类型说明
rcInt32返回码,0=成功
rmsgString返回信息
cancelCountInt32成功撤单数量
failCountInt32撤单失败数量
failListArray失败详情列表(仅失败时返回)

failList 元素字段:

字段类型说明
orderIDString委托单ID
rmsgString失败原因

4. 委托查询

  • 功能:查询账户下的所有委托订单(含已成交、未成交、已撤单)以及账户的历史成交记录。
  • 触发词查询委托我的订单委托记录查询成交记录历史成交交易历史成交记录历史成交记录我的成交记录我的历史成交我的交易历史查询账户成交记录查询账户交易历史
  • 请求地址${MX_API_URL}/api/claw/mockTrading/orders
  • 请求体{ "fltOrderDrt": 0, "fltOrderStatus": 0 }
  • 成功响应{ }
参数必填说明
fltOrderDrt0=全部(默认),1=买入,2=卖出
fltOrderStatus0=全部(默认),2=已报,4=已成 等
curl -X POST "${MX_API_URL}/api/claw/mockTrading/orders" \
  -H "apikey: ${MX_APIKEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "fltOrderDrt": 0,
    "fltOrderStatus": 0
  }'

响应示例:

{
  "code": "0",
  "data": {
    "rc": 0,
    "uid": "",
    "accID": "",
    "currency": 1,
    "currencyUnit": 1000,
    "totalNum": 2,
    "orders": [
      {
        "id": "20260314001",
        "secCode": "600519",
        "secName": "贵州茅台",
        "secMkt": 1,
        "drt": 1,
        "price": 185000,
        "priceDec": 2,
        "count": 100,
        "status": 4,
        "time": 1742000120
      }
    ]
  }
}

响应字段说明:

字段类型说明
accIDString账户ID
accNameString账户名称
currencyInt32账户币种:1=人民币,2=港币,3=美元
currencyUnitInt32币种最小面值,1000=厘

委托列表 orders 元素字段说明:

字段类型说明
idString委托单ID
statusInt32委托状态(见下表)
dbStatusInt32委托单原始状态(详见接口文档4.5.5)
timeInt64委托时间(Unix时间戳)
secCodeString证券代码
secTypeInt32证券类型:9=沪市基金,10=深市基金,其它=股票
secMktInt32证券市场号:0=深交所,1=上交所,116=港交所,105=纳斯达克
secNameString证券名称
drtUint32委托方向:1=买入,2=卖出
priceDecInt32委托价格小数位数
priceInt64委托价格(按 priceDec 放大为整数,还原:price / 10^priceDec)
typeInt32委托类型:1=限价单,2=增强限价单,5=市价委托
countInt64委托数量
tradeCountInt64成交数量
tradePriceInt64成交价格(按 priceDec 放大为整数)

委托状态 status 说明:

状态值含义
1未报
2已报
3部成
4已成
5部成待撤
6已报待撤
7部撤
8已撤
9废单
10撤单失败

5. 资金查询

  • 功能:查询账户可用资金与总资产。
  • 触发词查询资金我的资金账户余额资金情况资金信息账户资金查询账户资金查询账户余额查询资金情况查询资金信息查询我的资金情况查询我的账户余额
  • 请求地址${MX_API_URL}/api/claw/mockTrading/balance
  • 请求体{ }
  • 成功响应{ }
curl -X POST "${MX_API_URL}/api/claw/mockTrading/balance" \
  -H "apikey: ${MX_APIKEY}" \
  -H "Content-Type: application/json" \

响应示例:

{
  "code": "0",
  "data": {
    "rc": 0,
    "totalAssets": 125680500,
    "availBalance": 23450000,
    "frozenMoney": 500000,
    "totalPosValue": 102230500,
    "totalPosPct": 81.3,
    "currencyUnit": 1000
  }
}

资金查询响应字段说明:

字段类型说明
rcInt32返回码,0=成功
accIDString账户ID
accNameString账户名称
mktTypeUint32市场类型:30106=初始组合,30108=普通组合
currencyInt32账户币种:1=人民币,2=港币,3=美元
currencyUnitInt32币种最小面值,1000=厘
initMoneyInt64初始资金(厘)
totalAssetsInt64总资产(厘)
balanceActualInt64账户余额(厘)
availBalanceInt64可用余额(厘)
frozenMoneyInt64冻结金额(厘)
totalPosValueInt64总持仓市值(厘)
totalPosPctDouble总持仓仓位%
navDouble单位净值
oprDaysInt32运作天数

️ 安全与错误处理

错误类型处理方式
今日调用次数已达上限 (113)提示用户前往妙想Skills页面,更新apikey
API密钥不存在或已失效,请确认密钥是否正确 (114)提示用户前往妙想Skills页面,更新apikey
请求未携带API密钥,请检查请求参数 (115)提示用户检查 MX_APIKEY 是否配置正确
API密钥不存在,请确认密钥是否正确 (116)提示用户检查 MX_APIKEY 是否配置正确
未绑定模拟组合账户 (404)提示用户前往妙想Skills页面创建并绑定模拟账户
网络错误重试最多3次,仍失败则提示“网络异常,请稍后重试”

配置要求

  • MX_APIKEY:妙想Skills页面获取的apikey,需保密。
  • MX_API_URL:模拟交易API的基础URL。
  • 依赖工具curl(用于发起请求)、jq(用于解析JSON响应)。

Files

3 total
Select a file
Select a file to preview.

Comments

Loading comments…