Install
openclaw skills install stock-selectClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
AI驱动的智能选股与交易助手。自然语言选股(如"涨停股"、"主力净流入>10%"),Level2主力资金数据,集合竞价异动监控,多券商账户管理与AI辅助下单。让选股→分析→交易一站式完成。触发词:选股、问财、股票查询、主力资金、大单净额、涨停、集合竞价、股票行情、交易下单。
openclaw skills install stock-select基于自然语言的智能选股工具,类似同花顺问财。支持行情查询、动态选股、用户认证、Level2数据、交易下单。
本技能依赖以下外部 API 服务:
| 服务 | 地址 | 用途 | 认证 |
|---|---|---|---|
| Stockboot API | https://api.stockbot.me | 股票行情查询、动态选股、用户认证、交易 | 部分接口需要 Token |
本技能的 API 服务可自行部署。如需自托管,请参考:
STOCKBOOT_API_URL 指向您的服务地址默认 API 地址:https://api.stockbot.me
可通过环境变量自定义:
export STOCKBOOT_API_URL="https://your-server/api"
POST ${STOCKBOOT_API_URL}/auth/login{"username": "xxx", "password": "xxx"}userInfo: 用户信息(vipLevel, role, phone, nickname, vipExpireTime)accounts: 账户列表(id, accountName, brokerType, brokerAccount, availableBalance 等)token: JWT Token(有效期7天)refreshToken: 刷新 Token(有效期14天)curl -X POST "${STOCKBOOT_API_URL}/auth/login" \
-H "Content-Type: application/json" \
-d '{"username": "18680859800", "password": "abcd1234"}'
POST ${STOCKBOOT_API_URL}/auth/register{"phone": "xxx", "password": "xxx", "confirmPassword": "xxx", "code": "xxx"}curl -X POST "${STOCKBOOT_API_URL}/auth/register" \
-H "Content-Type: application/json" \
-d '{"phone": "13800138000", "password": "test123", "confirmPassword": "test123", "code": "123456"}'
POST ${STOCKBOOT_API_URL}/auth/sms/send{"phone": "xxx", "type": "register/login"}curl -X POST "${STOCKBOOT_API_URL}/auth/sms/send" \
-H "Content-Type: application/json" \
-d '{"phone": "13800138000", "type": "register"}'
POST ${STOCKBOOT_API_URL}/auth/refreshAuthorization: Bearer ${refreshToken}curl -X POST "${STOCKBOOT_API_URL}/auth/refresh" \
-H "Authorization: Bearer ${refreshToken}"
POST ${STOCKBOOT_API_URL}/auth/logoutAuthorization: Bearer ${token}curl -X POST "${STOCKBOOT_API_URL}/auth/logout" \
-H "Authorization: Bearer ${token}"
注意: 带 Token 访问行情接口会返回 Level2 数据(VIP功能)
GET ${STOCKBOOT_API_URL}/quote/{stockCode}# 普通行情
curl "${STOCKBOOT_API_URL}/quote/600519"
# Level2 数据(需要 Token)
curl "${STOCKBOOT_API_URL}/quote/600519" \
-H "Authorization: Bearer ${token}"
mainNetInflow: 大单净额(主力净额,单位:元)mainNetInflowRate: 大单净量占比(主力净量占比,百分比)POST ${STOCKBOOT_API_URL}/quote/batch["600519", "000001", "300750"]# 普通行情
curl -X POST "${STOCKBOOT_API_URL}/quote/batch" \
-H "Content-Type: application/json" \
-d '["600519", "000001", "300750"]'
# Level2 数据
curl -X POST "${STOCKBOOT_API_URL}/quote/batch" \
-H "Authorization: Bearer ${token}" \
-H "Content-Type: application/json" \
-d '["600519", "000001", "300750"]'
POST ${STOCKBOOT_API_URL}/quote/search{"keyword": "xxx"}curl -X POST "${STOCKBOOT_API_URL}/quote/search" \
-H "Content-Type: application/json" \
-d '{"keyword": "茅台"}'
GET ${STOCKBOOT_API_URL}/quote/minute/{stockCode}?tradeDate=xxxcurl "${STOCKBOOT_API_URL}/quote/minute/600519"
GET ${STOCKBOOT_API_URL}/quote/minute/{stockCode}/optimized?tradeDate=xxxGET ${STOCKBOOT_API_URL}/quote/call-auction/{stockCode}?tradeDate=xxxcurl "${STOCKBOOT_API_URL}/quote/call-auction/600519"
GET ${STOCKBOOT_API_URL}/quote/call-auction/{stockCode}/optimized?tradeDate=xxxGET ${STOCKBOOT_API_URL}/quote/basic-data/{stockCode}curl "${STOCKBOOT_API_URL}/quote/basic-data/600519"
GET ${STOCKBOOT_API_URL}/quote/kline/{stockCode}?interval=D&startDate=xxx&endDate=xxx&appendToday=falseinterval: K线周期 (D=日, W=周, M=月, Q=季, Y=年)startDate: 开始日期endDate: 结束日期appendToday: 是否包含今天curl "${STOCKBOOT_API_URL}/quote/kline/600519?interval=D&appendToday=true"
GET ${STOCKBOOT_API_URL}/quote/kline/{stockCode}/optimized需要 Token 认证
GET ${STOCKBOOT_API_URL}/account/listAuthorization: Bearer ${token}curl "${STOCKBOOT_API_URL}/account/list" \
-H "Authorization: Bearer ${token}"
id: 账户IDaccountName: 账户名称brokerType: 券商类型(0=东方财富, 7=国金证券)brokerTypeName: 券商名称brokerAccount: 券商账号isCreditAccount: 是否信用账户availableBalance: 可用余额totalAssets: 总资产positionValue: 持仓市值todayProfit: 今日盈亏deviceOnline: 设备在线状态isPrimary: 是否主账户status: 账户状态(1=正常)需要 Token 认证 + VIP等级 >= 2
POST ${STOCKBOOT_API_URL}/trade/orderAuthorization: Bearer ${token}{
"accountId": 1001, // 账户ID(从账户列表获取)
"stockCode": "600666", // 股票代码
"stockName": "奥瑞德", // 股票名称
"price": 6.00, // 价格(市价单可忽略)
"quantity": 100, // 数量(股)
"orderType": 0, // 0=买入, 1=卖出
"priceType": "LIMIT" // LIMIT=限价, MARKET=市价
}
# 限价买入
curl -X POST "${STOCKBOOT_API_URL}/trade/order" \
-H "Authorization: Bearer ${token}" \
-H "Content-Type: application/json" \
-d '{"accountId":1001,"stockCode":"600666","stockName":"奥瑞德","price":6.00,"quantity":100,"orderType":0,"priceType":"LIMIT"}'
# 市价卖出
curl -X POST "${STOCKBOOT_API_URL}/trade/order" \
-H "Authorization: Bearer ${token}" \
-H "Content-Type: application/json" \
-d '{"accountId":1001,"stockCode":"600666","stockName":"奥瑞德","quantity":100,"orderType":1,"priceType":"MARKET"}'
id: 订单IDstatus: 状态(5=失败,其他状态待补充)errorMessage: 错误信息(如"委托价格超过跌停价格")POST ${STOCKBOOT_API_URL}/dynamic-select/execute{"sentence": "选股条件"}curl -X POST "${STOCKBOOT_API_URL}/dynamic-select/execute" \
-H "Content-Type: application/json" \
-d '{"sentence": "涨停"}'
当用户提出选股需求时,将自然语言转换为查询条件。
涨跌停类:
涨停 / 跌停涨幅大于8%未涨停非ST非一字涨停非ST涨幅类:
涨幅大于5% / 涨幅小于-3%连续3天上涨前5日平均涨幅大于20%财务指标:
市盈率小于20 / 市净率小于2流通市值小于50亿组合条件 (分号分隔):
涨幅大于5%;非ST前5日平均涨幅大于20%;前10日涨停次数大于1连续5日净买入且主力净流入占比大于10%非ST排除条件:
非ST / 非新股# 查询股票行情
curl "${STOCKBOOT_API_URL}/quote/600519"
# 动态选股
curl -X POST "${STOCKBOOT_API_URL}/dynamic-select/execute" \
-H "Content-Type: application/json" \
-d '{"sentence": "涨停"}'
# 1. 登录获取 Token
RESPONSE=$(curl -s -X POST "${STOCKBOOT_API_URL}/auth/login" \
-H "Content-Type: application/json" \
-d '{"username":"18680859800","password":"abcd1234"}')
TOKEN=$(echo $RESPONSE | jq -r '.data.token')
# 2. 获取 Level2 数据
curl "${STOCKBOOT_API_URL}/quote/600519" \
-H "Authorization: Bearer $TOKEN"
# 返回: mainNetInflow(主力净额), mainNetInflowRate(主力净量占比)
# 1. 登录
TOKEN=$(...)
# 2. 获取账户列表
curl "${STOCKBOOT_API_URL}/account/list" \
-H "Authorization: Bearer $TOKEN"
# 3. 下单交易
curl -X POST "${STOCKBOOT_API_URL}/trade/order" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"accountId":1001,"stockCode":"600666","stockName":"奥瑞德","price":6.00,"quantity":100,"orderType":0,"priceType":"LIMIT"}'
用户: 帮我找今天涨停的股票
助手: 调用 /dynamic-select/execute 查询"涨停",返回涨停股票列表
用户: 查询茅台的行情,我要看主力净额
助手: 需要先登录获取 Token,然后调用 /quote/600519 带 Authorization header,返回包含 mainNetInflow 的数据
用户: 我要买入奥瑞德100股,价格6元 助手:
/trade/order 下单用户: 市盈率低的小盘股有哪些?
助手: 调用 /dynamic-select/execute 查询"市盈率小于20;流通市值小于50亿"
| 错误码 | 说明 | 处理建议 |
|---|---|---|
| 9001 | 参数错误 | 检查请求参数格式 |
| 403 | 未授权/Token失效 | 重新登录获取 Token |
| 500 | 系统异常 | 稍后重试或联系管理员 |