name: trade-tactics
version: 1.0.0
description: 股票交易战术决策器(择时+仓位+止盈止损+持有周期一站式)
author: wechat-ops-skills
license: MIT
platform: ['cn-stock', 'hk-stock', 'us-stock']
tags: ['股票', '交易', '战术', '择时', '仓位']
category: 量化交易
trigger: ["trade-tactics", "交易战术", "买点卖点", "仓位建议"]
inputs:
code:
type: string
required: true
description: 股票代码(如 600519、00700、AAPL)
name:
type: string
required: false
description: 股票名称(可自动查)
strategy:
type: string
required: false
enum: [swing, trend, overnight, position]
default: swing
description: 交易策略(swing=波段/trend=趋势/overnight=隔夜/position=中长线)
risk_tolerance:
type: string
required: false
enum: [conservative, balanced, aggressive]
default: balanced
description: 风险偏好
capital:
type: number
required: false
default: 100000
description: 总资金(元)
current_price:
type: number
required: false
description: 当前价(不传则自动拉)
cost_basis:
type: number
required: false
description: 已持仓成本(已持仓时填)
kline:
type: array
required: false
description: K 线数据(不传则 mock)
outputs:
tactic_rating:
type: string
description: 战术评级 S/A/B/C/D
overall_score:
type: number
description: 综合评分 0-100
primary_entry:
type: object
description: 首选买点(价格区间+触发条件+概率)
backup_entry:
type: object
description: 备选买点
entry_plan:
type: array
description: 分批建仓方案
stop_loss_plan:
type: object
description: 止损方案(硬止损+移动止盈+时间止损)
holding_plan:
type: object
description: 持有计划(周期+减仓节奏+加仓条件)
risks:
type: array
description: 风险提示列表
risk_caps:
type: object
description: 风险上限(仓位+回撤)
股票交易战术决策器
适用场景
把"一只已经选出来的股票"变成"可执行的交易方案":明确什么时候买、买多少、什么时候卖、拿多久。
- 跟现有
stock-lianghuafenxi-tdx(量化选股)完美串联:选股 → 战术 - 输出 5 大模块:战术评级、入场时机、仓位方案、风险管控、持有计划
- 覆盖 4 种策略:波段、趋势、隔夜、中长线
- 3 档风险偏好:保守、稳健、激进
- 强制仓位/止损合规校验,不会给出超过风险上限的方案
触发
/trade-tactics
交易战术
买点卖点
平台
cn-stock(A 股)、hk-stock(港股)、us-stock(美股)
标签
股票, 交易, 战术, 择时, 仓位
输入参数
code: "600519" # 必填,股票代码
name: "贵州茅台" # 可选
strategy: "swing" # swing/trend/overnight/position
risk_tolerance: "balanced" # conservative/balanced/aggressive
capital: 100000 # 总资金
current_price: 1720 # 当前价(不传则自动拉)
kline: [...] # K 线(不传则 mock)
输出示例(节选)
{
"tactic_rating": "A",
"overall_score": 78,
"summary": "均线多头排列 + MACD 在零轴上方,建议回调至 20 日线分批建仓。",
"primary_entry": {
"price_range": "1690-1700",
"trigger": "回踩 20 日线且 MACD 不死叉",
"probability": "约 60-65%"
},
"entry_plan": [
{"batch": 1, "price": "1695", "position_pct": 30, "trigger": "20 日线止跌"},
{"batch": 2, "price": "1670", "position_pct": 30, "trigger": "缩量止跌 + 北向净流入"},
{"batch": 3, "price": "1760", "position_pct": 40, "trigger": "突破前高站上 3 天"}
],
"stop_loss_plan": {
"hard_stop_price": 1650,
"trailing_stop": "收盘价跌破 10 日线止盈 50%",
"time_stop": "60 天不涨超 10% 减仓"
},
"holding_plan": {
"expected_holding_days": 90,
"first_trim": "+20% 止盈 30%",
"second_trim": "+40% 止盈 50%",
"add_position_condition": "业绩超预期 + 北向连续 5 日净流入"
}
}
与已有 Skill 的协同
stock-lianghuafenxi-tdx(选股)
↓ 输出 code + 评级
trade-tactics(本 Skill:战术)
↓ 输出 entry_plan + stop_loss
用户执行交易
↓
trading-journal-ai(交易复盘,后续)
详细说明
本 Skill 由 wechat_ops_skills.skills.trade_tactics 提供实现。
数据源
- 默认:内置 Mock K 线(开箱即用)
- 生产:通过
config.yaml配置 akshare token,对接ak.stock_zh_a_hist()等接口 - 用户导入:直接传
kline参数(CSV/JSON 均可)
风险提示
- 本 Skill 输出仅作交易参考,不构成投资建议
- 任何战术都有失败概率,请结合自身风险承受能力使用
- 实盘前请用小仓位验证策略有效性
详细文档
参见 prompts/tactics.md 与 config.example.yaml。