stock-analysis-plugin 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +498 -0
  2. package/package.json +88 -0
  3. package/pi/index.ts +1142 -0
  4. package/schemas/market_review_schema.json +176 -0
  5. package/schemas/report_schema.json +131 -0
  6. package/scripts/setup-python.mjs +57 -0
  7. package/scripts/sync-version.sh +56 -0
  8. package/scripts/venv-python.mjs +20 -0
  9. package/skills/bottom-volume/SKILL.md +63 -0
  10. package/skills/bottom-volume/scripts/gather.py +22 -0
  11. package/skills/box-oscillation/SKILL.md +72 -0
  12. package/skills/box-oscillation/scripts/gather.py +22 -0
  13. package/skills/bull-trend/SKILL.md +60 -0
  14. package/skills/bull-trend/scripts/gather.py +22 -0
  15. package/skills/chan-theory/SKILL.md +71 -0
  16. package/skills/chan-theory/scripts/gather.py +22 -0
  17. package/skills/dragon-head/SKILL.md +69 -0
  18. package/skills/dragon-head/scripts/gather.py +22 -0
  19. package/skills/emotion-cycle/SKILL.md +65 -0
  20. package/skills/emotion-cycle/scripts/gather.py +22 -0
  21. package/skills/event-driven/SKILL.md +73 -0
  22. package/skills/event-driven/scripts/gather.py +22 -0
  23. package/skills/expectation-repricing/SKILL.md +72 -0
  24. package/skills/expectation-repricing/scripts/gather.py +22 -0
  25. package/skills/growth-quality/SKILL.md +74 -0
  26. package/skills/growth-quality/scripts/gather.py +22 -0
  27. package/skills/hot-theme/SKILL.md +74 -0
  28. package/skills/hot-theme/scripts/gather.py +22 -0
  29. package/skills/ma-crossover/SKILL.md +63 -0
  30. package/skills/ma-crossover/scripts/gather.py +22 -0
  31. package/skills/market-review/SKILL.md +70 -0
  32. package/skills/market-review/scripts/gather.py +23 -0
  33. package/skills/one-yang-three-yin/SKILL.md +74 -0
  34. package/skills/one-yang-three-yin/scripts/gather.py +22 -0
  35. package/skills/shrink-pullback/SKILL.md +59 -0
  36. package/skills/shrink-pullback/scripts/gather.py +22 -0
  37. package/skills/stock-analysis/SKILL.md +134 -0
  38. package/skills/stock-analysis/scripts/gather.py +22 -0
  39. package/skills/stock-screener/SKILL.md +68 -0
  40. package/skills/stock-screener/scripts/gather.py +22 -0
  41. package/skills/strategy-backtest/SKILL.md +129 -0
  42. package/skills/strategy-backtest/scripts/gather.py +23 -0
  43. package/skills/volume-breakout/SKILL.md +58 -0
  44. package/skills/volume-breakout/scripts/gather.py +22 -0
  45. package/skills/wave-theory/SKILL.md +67 -0
  46. package/skills/wave-theory/scripts/gather.py +22 -0
  47. package/skills/wisburg-research/SKILL.md +119 -0
  48. package/strategies/examples/bottom_volume.yaml +47 -0
  49. package/strategies/examples/box_oscillation.yaml +41 -0
  50. package/strategies/examples/bull_trend.yaml +42 -0
  51. package/strategies/examples/dragon_head.yaml +45 -0
  52. package/strategies/examples/emotion_cycle.yaml +43 -0
  53. package/strategies/examples/ma_crossover.yaml +34 -0
  54. package/strategies/examples/rsi_oversold.yaml +35 -0
  55. package/strategies/examples/shrink_pullback.yaml +45 -0
  56. package/strategies/examples/volume_breakout.yaml +42 -0
  57. package/templates/_macros.j2 +90 -0
  58. package/templates/market_review/full.md.j2 +103 -0
  59. package/templates/stock_analysis/brief.md.j2 +28 -0
  60. package/templates/stock_analysis/full.md.j2 +108 -0
  61. package/tools/__init__.py +0 -0
  62. package/tools/alert_rules.py +243 -0
  63. package/tools/anomaly_detect.py +575 -0
  64. package/tools/backtest.py +764 -0
  65. package/tools/capabilities.py +108 -0
  66. package/tools/diagnostics.py +146 -0
  67. package/tools/gather.py +157 -0
  68. package/tools/import_parser.py +279 -0
  69. package/tools/market_regime.py +252 -0
  70. package/tools/market_review.py +155 -0
  71. package/tools/name_resolver.py +136 -0
  72. package/tools/pattern.py +515 -0
  73. package/tools/position_context.py +161 -0
  74. package/tools/report_renderer.py +116 -0
  75. package/tools/requirements.txt +15 -0
  76. package/tools/risk_screening.py +323 -0
  77. package/tools/screener.py +219 -0
  78. package/tools/search_intel.py +504 -0
  79. package/tools/stock_data.py +1721 -0
  80. package/tools/technical.py +642 -0
  81. package/tools/trading_calendar.py +226 -0
  82. package/tools/volume_analysis.py +178 -0
  83. package/tools/watchlist.py +66 -0
  84. package/tools/watchlist_context.py +185 -0
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python3
2
+ """Gather screening results."""
3
+
4
+ import subprocess
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ # Windows defaults stdio to a legacy code page (cp1252); force UTF-8 so the
9
+ # child's Chinese output both decodes and re-prints here without crashing.
10
+ for _s in (sys.stdout, sys.stderr):
11
+ if hasattr(_s, "reconfigure"):
12
+ _s.reconfigure(encoding="utf-8")
13
+
14
+ tools = Path(__file__).resolve().parents[2] / "tools"
15
+ result = subprocess.run(
16
+ [sys.executable, str(tools / "gather.py"), "screen"] + sys.argv[1:],
17
+ capture_output=True,
18
+ text=True,
19
+ encoding="utf-8",
20
+ )
21
+ sys.stdout.write(result.stdout)
22
+ sys.exit(result.returncode)
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: strategy-backtest
3
+ description: 策略回测与优化 — AlphaEvo YAML策略定义、回测、诊断、进化。当用户要求回测交易策略时使用。
4
+ allowed-tools: Bash(python3:*) Read
5
+ ---
6
+
7
+ # 策略回测与优化
8
+
9
+ 你是一位量化策略研究员。帮助用户定义、回测、诊断和优化交易策略。
10
+
11
+ ## 工作流程
12
+
13
+ ### 第一步:策略定义
14
+
15
+ 帮助用户将交易思路转化为 YAML 策略文件。策略 DSL 格式:
16
+
17
+ ```yaml
18
+ name: "策略名称"
19
+ version: "1.0"
20
+ description: "策略描述"
21
+
22
+ parameters:
23
+ param1: value1
24
+
25
+ entry:
26
+ conditions:
27
+ - indicator: "rsi" # 指标名
28
+ period: 14 # 指标周期
29
+ operator: "<" # 比较运算符
30
+ value: 30 # 阈值
31
+ logic: "all" # all=AND, any=OR
32
+
33
+ exit:
34
+ conditions:
35
+ - indicator: "rsi"
36
+ period: 14
37
+ operator: ">"
38
+ value: 70
39
+ logic: "any"
40
+ stop_loss: -0.05 # 止损比例
41
+ take_profit: 0.15 # 止盈比例
42
+
43
+ position:
44
+ size: 1.0 # 仓位比例
45
+ max_positions: 1 # 最大持仓数
46
+ ```
47
+
48
+ **可用指标**:rsi, ma, ema, macd_dif, macd_dea, macd, volume_ratio, price_change, bollinger_position, close, volume
49
+
50
+ **可用运算符**:`>`, `<`, `>=`, `<=`, `==`, `cross_above`, `cross_below`
51
+
52
+ ### 第二步:运行回测
53
+
54
+ 运行回测脚本:
55
+
56
+ ```bash
57
+ python3 scripts/gather.py --strategy <path.yaml> --symbol <symbol> --start <date> --end <date>
58
+ ```
59
+
60
+ 参数说明:
61
+ - `--strategy`:策略 YAML 文件路径
62
+ - `--symbol`:股票代码
63
+ - `--start` / `--end`:回测时间范围(可选,默认近一年)
64
+ - 初始资金默认 100 万
65
+
66
+ ### 第三步:分析结果
67
+
68
+ 回测完成后,详细分析各项指标:
69
+
70
+ | 指标 | 优秀 | 良好 | 需改进 |
71
+ |------|------|------|--------|
72
+ | 总收益率 | >20% | 5-20% | <5% |
73
+ | 最大回撤 | <10% | 10-20% | >20% |
74
+ | 胜率 | >60% | 40-60% | <40% |
75
+ | 盈亏比 | >2:1 | 1-2:1 | <1:1 |
76
+ | 夏普比率 | >1.5 | 0.5-1.5 | <0.5 |
77
+
78
+ ### 第四步:诊断与优化
79
+
80
+ 根据回测结果诊断问题并提出变异方案:
81
+
82
+ **常见问题 → 优化方向**:
83
+ - 胜率低 → 收紧入场条件、增加过滤因子
84
+ - 盈亏比低 → 提高止盈、收紧止损
85
+ - 回撤大 → 减小仓位、增加止损保护
86
+ - 交易次数少 → 放宽条件、缩短信号周期
87
+ - 交易次数多 → 增加冷却期、提高信号门槛
88
+
89
+ ### 第五步:进化迭代
90
+
91
+ 1. 根据诊断修改策略 YAML 参数
92
+ 2. 重新运行回测
93
+ 3. 对比前后结果
94
+ 4. 重复直到满意
95
+
96
+ ## 输出格式
97
+
98
+ ```
99
+ ## 回测报告 — [策略名称] on [股票代码]
100
+
101
+ ### 策略概要
102
+ - 名称:...
103
+ - 入场条件:...
104
+ - 出场条件:...
105
+ - 止损/止盈:...
106
+
107
+ ### 核心指标
108
+ | 指标 | 值 | 评级 |
109
+ |------|----|------|
110
+ | 总收益率 | ... | ⭐⭐⭐ |
111
+ | ... | ... | ... |
112
+
113
+ ### 交易明细
114
+ 最近 N 笔交易列表
115
+
116
+ ### 诊断
117
+ - 优势:...
118
+ - 问题:...
119
+ - 优化建议:...
120
+
121
+ ### 下一步
122
+ 建议的参数调整方案
123
+ ```
124
+
125
+ ## 示例策略
126
+
127
+ 参考 `{baseDir}/strategies/examples/` 目录中的示例:
128
+ - `rsi_oversold.yaml` — RSI 超卖反弹
129
+ - `ma_crossover.yaml` — 均线金叉
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env python3
2
+ """Run backtest and return results."""
3
+
4
+ import subprocess
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ # Windows defaults stdio to a legacy code page (cp1252); force UTF-8 so the
9
+ # child's Chinese output both decodes and re-prints here without crashing.
10
+ for _s in (sys.stdout, sys.stderr):
11
+ if hasattr(_s, "reconfigure"):
12
+ _s.reconfigure(encoding="utf-8")
13
+
14
+ tools = Path(__file__).resolve().parents[2] / "tools"
15
+ result = subprocess.run(
16
+ [sys.executable, str(tools / "backtest.py"), "run"] + sys.argv[1:],
17
+ capture_output=True,
18
+ text=True,
19
+ encoding="utf-8",
20
+ timeout=120,
21
+ )
22
+ sys.stdout.write(result.stdout)
23
+ sys.exit(result.returncode)
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: volume-breakout
3
+ description: 放量突破策略 — 识别关键位置的放量突破行情。当用户要求分析突破形态时使用。
4
+ allowed-tools: Bash(python3:*) Read
5
+ ---
6
+
7
+ # 放量突破分析
8
+
9
+ 你是一位专注突破形态的交易专家。
10
+
11
+ ## 核心理念
12
+
13
+ 真正的突破需要成交量的配合。放量突破关键阻力位(前高、平台、颈线、均线压制),意味着买方力量压倒卖方,是趋势加速或反转的信号。
14
+
15
+ ## 执行流程
16
+
17
+ ### 1. 采集数据
18
+
19
+ 运行数据采集脚本获取 90 根日K线及技术指标:
20
+
21
+ ```bash
22
+ python3 scripts/gather.py <symbol>
23
+ ```
24
+
25
+ ### 2. 识别关键阻力位
26
+
27
+ - **前高**:近 60 日最高价
28
+ - **平台上沿**:长期横盘区间的上边界
29
+ - **均线压制**:MA60 或 MA120(如价格长期运行在下方)
30
+ - **布林带上轨**:BOLL upper
31
+ - **整数关口**:心理价位
32
+
33
+ ### 3. 突破有效性判断
34
+
35
+ **有效突破条件**:
36
+ - 收盘价突破阻力位(不仅是盘中触及)
37
+ - 成交量至少放大到前 5 日均量的 2 倍(量比 ≥ 2)
38
+ - 突破当日为中阳线或大阳线(涨幅 > 3%)
39
+ - 突破后 2-3 日不回落至阻力位下方
40
+
41
+ **假突破特征**:
42
+ - 盘中突破但收盘回落(长上影线)
43
+ - 突破时缩量
44
+ - 突破后立即回落至阻力位下方
45
+
46
+ ### 4. 突破后操作
47
+
48
+ - **追涨买入**:突破当日或回踩确认后买入
49
+ - **止损位**:阻力位下方 2%-3%(突破失败立即离场)
50
+ - **目标位**:前一波下跌/盘整幅度的等幅上涨
51
+
52
+ ## 输出要求
53
+
54
+ 1. 当前关键阻力位标注
55
+ 2. 是否出现突破信号(或即将突破)
56
+ 3. 突破有效性评级和依据
57
+ 4. 买入区间、止损位、目标位
58
+ 5. 假突破风险提示
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python3
2
+ """Gather technical data for volume-breakout analysis."""
3
+
4
+ import subprocess
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ # Windows defaults stdio to a legacy code page (cp1252); force UTF-8 so the
9
+ # child's Chinese output both decodes and re-prints here without crashing.
10
+ for _s in (sys.stdout, sys.stderr):
11
+ if hasattr(_s, "reconfigure"):
12
+ _s.reconfigure(encoding="utf-8")
13
+
14
+ tools = Path(__file__).resolve().parents[2] / "tools"
15
+ result = subprocess.run(
16
+ [sys.executable, str(tools / "gather.py"), "technical", sys.argv[1], "--kline-count", "90"],
17
+ capture_output=True,
18
+ text=True,
19
+ encoding="utf-8",
20
+ )
21
+ sys.stdout.write(result.stdout)
22
+ sys.exit(result.returncode)
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: wave-theory
3
+ description: 波浪理论分析 — 基于Elliott波浪理论的浪形识别和推演。当用户要求波浪分析时使用。
4
+ allowed-tools: Bash(python3:*) Read
5
+ ---
6
+
7
+ # 波浪理论分析
8
+
9
+ 你是一位精通 Elliott 波浪理论的交易专家。
10
+
11
+ ## 核心理念
12
+
13
+ 市场走势遵循"5 浪推动 + 3 浪调整"的基本模式。通过识别当前所处的浪形位置,预判后续走势方向和幅度。
14
+
15
+ ## 执行流程
16
+
17
+ ### 1. 采集数据
18
+
19
+ 运行数据采集脚本获取 120 根日K线及技术指标:
20
+
21
+ ```bash
22
+ python3 scripts/gather.py <symbol>
23
+ ```
24
+
25
+ ### 2. 推动浪识别(1-2-3-4-5)
26
+
27
+ **基本规则**:
28
+ - 浪2 不能跌破浪1 的起点
29
+ - 浪3 不能是推动浪中最短的
30
+ - 浪4 不能进入浪1 的价格区间
31
+
32
+ **各浪特征**:
33
+ | 浪 | 特征 | 量价 |
34
+ |----|------|------|
35
+ | 1浪 | 底部启动,市场半信半疑 | 温和放量 |
36
+ | 2浪 | 回调,市场认为是反弹结束 | 缩量 |
37
+ | 3浪 | 主升浪,最长最强 | 持续放量 |
38
+ | 4浪 | 调整,形态复杂 | 量能递减 |
39
+ | 5浪 | 末升浪,分歧加大 | 量价背离 |
40
+
41
+ ### 3. 调整浪识别(A-B-C)
42
+
43
+ - **A浪**:初始下跌,多数人认为回调
44
+ - **B浪**:反弹,形成"牛市陷阱"
45
+ - **C浪**:破坏性下跌,恐慌出现
46
+
47
+ **调整浪形态**:锯齿形(5-3-5)、平坦形(3-3-5)、三角形(3-3-3-3-3)
48
+
49
+ ### 4. 斐波那契关系
50
+
51
+ - 浪2 回调浪1 的 38.2%-61.8%
52
+ - 浪3 = 浪1 的 1.618 倍(最常见)
53
+ - 浪4 回调浪3 的 23.6%-38.2%
54
+ - 浪5 = 浪1(等长)或 浪3 的 0.618 倍
55
+ - C浪 = A浪 或 A浪的 1.618 倍
56
+
57
+ ### 5. 浪形定位
58
+
59
+ 结合以上分析确定当前所处浪形位置,推演后续可能走势。
60
+
61
+ ## 输出要求
62
+
63
+ 1. 当前波浪结构标注(从最近明确的起点开始)
64
+ 2. 当前所处浪形位置
65
+ 3. 各浪的斐波那契测量
66
+ 4. 后续走势推演(最可能的路径)
67
+ 5. 关键价位(各浪的目标位和否定位)
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python3
2
+ """Gather technical data for wave-theory analysis."""
3
+
4
+ import subprocess
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ # Windows defaults stdio to a legacy code page (cp1252); force UTF-8 so the
9
+ # child's Chinese output both decodes and re-prints here without crashing.
10
+ for _s in (sys.stdout, sys.stderr):
11
+ if hasattr(_s, "reconfigure"):
12
+ _s.reconfigure(encoding="utf-8")
13
+
14
+ tools = Path(__file__).resolve().parents[2] / "tools"
15
+ result = subprocess.run(
16
+ [sys.executable, str(tools / "gather.py"), "technical", sys.argv[1], "--kline-count", "120"],
17
+ capture_output=True,
18
+ text=True,
19
+ encoding="utf-8",
20
+ )
21
+ sys.stdout.write(result.stdout)
22
+ sys.exit(result.returncode)
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: wisburg-research
3
+ description: 智堡投研数据检索 — 投行研报、个股研究、财报公告、电话会纪要、市场日报、资讯流
4
+ ---
5
+
6
+ # 智堡(Wisburg)投研数据检索
7
+
8
+ 你是一位投研分析助手,通过智堡 MCP 服务获取专业金融研究数据。智堡涵盖海外投行研报、国内券商研究、资管报告、央行/政府文献、电话会纪要、财报公告等。
9
+
10
+ ## 可用工具
11
+
12
+ 智堡 MCP 提供以下工具(通过 `mcp__wisburg-mcp-server__` 前缀调用):
13
+
14
+ ### 研报类
15
+ | 工具 | 用途 |
16
+ |------|------|
17
+ | `list-institutional-reports` | 投行/券商行业研报(高盛、摩根、中信等) |
18
+ | `list-company-reports` | 个股研究报告 |
19
+ | `list-am-reports` | 资管公司投资策略与市场展望 |
20
+ | `list-archive-reports` | 央行报告、政府政策、智库研究 |
21
+ | `get-report-detail` | 获取研报全文(需 id + category) |
22
+
23
+ ### 财报 & 公告
24
+ | 工具 | 用途 |
25
+ |------|------|
26
+ | `list-earning-calls` | 电话会议纪要(业绩交流会) |
27
+ | `list-filings` | 财报公告(支持 cn/hk/us 三市场) |
28
+ | `get-filing-detail` | 财报详情(需 market + id) |
29
+
30
+ ### 资讯 & 文章
31
+ | 工具 | 用途 |
32
+ |------|------|
33
+ | `list-feed` | 投研资讯流(每日更新的研究摘要) |
34
+ | `list-market-daily` | 金融市场日报(股债汇商+宏观政策) |
35
+ | `list-articles` | 深度研究文章(含 Mikko 日报) |
36
+ | `get-article-detail` | 文章全文(需 id) |
37
+
38
+ ### 其他
39
+ | 工具 | 用途 |
40
+ |------|------|
41
+ | `list-images` | 金融数据图表与信息图 |
42
+ | `list-astock-qa` | A股投资者问答(语义搜索) |
43
+
44
+ ## 使用流程
45
+
46
+ ### 场景一:个股深度研究
47
+
48
+ 用户想了解某只股票的机构观点时:
49
+
50
+ 1. **`list-company-reports`** — `query` 填股票名称或代码,获取个股研报列表
51
+ 2. **`get-report-detail`** — 用返回的 `id` + `category: "company"` + `kind` 获取全文
52
+ 3. **`list-earning-calls`** — `query` 搜索该公司电话会纪要
53
+ 4. **`list-filings`** — `market` 填 cn/hk/us,`query` 搜索财报公告
54
+ 5. 综合以上信息输出机构观点汇总
55
+
56
+ ### 场景二:行业/宏观研究
57
+
58
+ 用户想了解某行业或宏观趋势时:
59
+
60
+ 1. **`list-institutional-reports`** — `query` 填行业关键词(如"半导体"、"新能源")
61
+ 2. **`list-am-reports`** — 搜索资管机构的市场展望
62
+ 3. **`list-archive-reports`** — 搜索央行/政府相关政策文件
63
+ 4. **`get-report-detail`** — 获取重点报告全文
64
+ 5. 汇总各方观点,给出行业趋势判断
65
+
66
+ ### 场景三:每日市场速览
67
+
68
+ 用户想了解今日市场动态时:
69
+
70
+ 1. **`list-market-daily`** — `first: 3` 获取最近几天的市场日报
71
+ 2. **`list-feed`** — `first: 10` 获取最新投研资讯
72
+ 3. 提炼关键信息,输出今日要点
73
+
74
+ ### 场景四:A股投资者互动
75
+
76
+ 用户想了解某公司回复投资者的问题时:
77
+
78
+ 1. **`list-astock-qa`** — `query` 填公司名或股票代码,支持语义搜索
79
+
80
+ ## 工具参数说明
81
+
82
+ 所有 list 类工具共享以下参数:
83
+ - `first` — 每页条数(默认 20,最大 100)
84
+ - `after` — 翻页游标(从上一次返回的 cursor 获取)
85
+ - `query` — 搜索关键词(不填则按时间倒序)
86
+ - `startTime` / `endTime` — 时间筛选(ISO 8601 格式)
87
+
88
+ `get-report-detail` 参数:
89
+ - `id` — 报告 ID(从 list 结果获取)
90
+ - `category` — 必须匹配来源:`ib`(投行研报)、`company`(企业研究)、`am`(资管)、`archive`(文献)、`ec`(电话会)
91
+ - `kind` — 仅 ib/company 类别需要,从 list 结果中获取
92
+
93
+ `list-filings` / `get-filing-detail` 参数:
94
+ - `market` — 必填:`cn`(A股)、`hk`(港股)、`us`(美股)
95
+
96
+ ## 输出格式
97
+
98
+ ```
99
+ ## 投研速览:[主题]
100
+
101
+ ### 核心观点
102
+ - [机构名] [日期]:[观点摘要]
103
+ - ...
104
+
105
+ ### 关键数据
106
+ - ...
107
+
108
+ ### 风险提示
109
+ - ...
110
+
111
+ ### 信息来源
112
+ - [报告标题]([机构],[日期])
113
+ ```
114
+
115
+ ## 注意事项
116
+ - 投行研报(category: ib)因版权限制不提供原文链接
117
+ - 搜索不到结果时尝试换关键词(中文/英文/股票代码)
118
+ - 时间筛选有助于获取最新报告,避免过时信息
119
+ - 始终注明信息来源(机构、日期),方便用户验证
@@ -0,0 +1,47 @@
1
+ name: "Bottom Volume Reversal"
2
+ version: "1.0"
3
+ description: "底部放量策略 — 超跌后RSI进入超卖区,突然放量反弹时买入"
4
+
5
+ parameters:
6
+ rsi_period: 14
7
+ rsi_threshold: 35
8
+ volume_threshold: 2.0
9
+ stop_loss: -0.05
10
+ take_profit: 0.15
11
+
12
+ entry:
13
+ conditions:
14
+ - indicator: "rsi"
15
+ period: "{rsi_period}"
16
+ operator: "<"
17
+ value: "{rsi_threshold}"
18
+ - indicator: "volume_ratio"
19
+ period: 5
20
+ operator: ">"
21
+ value: "{volume_threshold}"
22
+ - indicator: "price_change"
23
+ operator: ">"
24
+ value: 1.0
25
+ - indicator: "bollinger_position"
26
+ period: 20
27
+ operator: "<"
28
+ value: 0.25
29
+ logic: "all"
30
+
31
+ exit:
32
+ conditions:
33
+ - indicator: "rsi"
34
+ period: "{rsi_period}"
35
+ operator: ">"
36
+ value: 65
37
+ - indicator: "bollinger_position"
38
+ period: 20
39
+ operator: ">"
40
+ value: 0.8
41
+ logic: "any"
42
+ stop_loss: "{stop_loss}"
43
+ take_profit: "{take_profit}"
44
+
45
+ position:
46
+ size: 0.6
47
+ max_positions: 1
@@ -0,0 +1,41 @@
1
+ name: "Box Oscillation"
2
+ version: "1.0"
3
+ description: "箱体震荡策略 — 股价在布林带下轨附近且RSI超卖时买入,在上轨附近且RSI超买时卖出"
4
+
5
+ parameters:
6
+ boll_buy: 0.15
7
+ boll_sell: 0.85
8
+ rsi_buy: 35
9
+ rsi_sell: 65
10
+ stop_loss: -0.05
11
+ take_profit: 0.12
12
+
13
+ entry:
14
+ conditions:
15
+ - indicator: "bollinger_position"
16
+ period: 20
17
+ operator: "<"
18
+ value: "{boll_buy}"
19
+ - indicator: "rsi"
20
+ period: 14
21
+ operator: "<"
22
+ value: "{rsi_buy}"
23
+ logic: "all"
24
+
25
+ exit:
26
+ conditions:
27
+ - indicator: "bollinger_position"
28
+ period: 20
29
+ operator: ">"
30
+ value: "{boll_sell}"
31
+ - indicator: "rsi"
32
+ period: 14
33
+ operator: ">"
34
+ value: "{rsi_sell}"
35
+ logic: "any"
36
+ stop_loss: "{stop_loss}"
37
+ take_profit: "{take_profit}"
38
+
39
+ position:
40
+ size: 0.8
41
+ max_positions: 1
@@ -0,0 +1,42 @@
1
+ name: "Bull Trend Following"
2
+ version: "1.0"
3
+ description: "趋势追踪策略 — 均线多头排列+MACD零轴上方时入场,趋势转弱时离场"
4
+
5
+ parameters:
6
+ stop_loss: -0.08
7
+ take_profit: 0.30
8
+
9
+ entry:
10
+ conditions:
11
+ - indicator: "ma_diff"
12
+ period: 510
13
+ operator: ">"
14
+ value: 0
15
+ - indicator: "ma_diff"
16
+ period: 1020
17
+ operator: ">"
18
+ value: 0
19
+ - indicator: "macd_dif"
20
+ operator: ">"
21
+ value: 0
22
+ - indicator: "volume_ratio"
23
+ operator: ">"
24
+ value: 0.8
25
+ logic: "all"
26
+
27
+ exit:
28
+ conditions:
29
+ - indicator: "ma_diff"
30
+ period: 510
31
+ operator: "cross_below"
32
+ value: 0
33
+ - indicator: "macd_dif"
34
+ operator: "cross_below"
35
+ value: 0
36
+ logic: "any"
37
+ stop_loss: "{stop_loss}"
38
+ take_profit: "{take_profit}"
39
+
40
+ position:
41
+ size: 1.0
42
+ max_positions: 1
@@ -0,0 +1,45 @@
1
+ name: "Dragon Head Momentum"
2
+ version: "1.0"
3
+ description: "龙头股动量策略 — 涨幅>5%+放量>2.5倍+趋势向上时追击强势股"
4
+
5
+ parameters:
6
+ min_change: 5.0
7
+ volume_threshold: 2.5
8
+ stop_loss: -0.06
9
+ take_profit: 0.25
10
+
11
+ entry:
12
+ conditions:
13
+ - indicator: "price_change"
14
+ operator: ">"
15
+ value: "{min_change}"
16
+ - indicator: "volume_ratio"
17
+ period: 5
18
+ operator: ">"
19
+ value: "{volume_threshold}"
20
+ - indicator: "ma_diff"
21
+ period: 510
22
+ operator: ">"
23
+ value: 0
24
+ logic: "all"
25
+
26
+ exit:
27
+ conditions:
28
+ - indicator: "price_change"
29
+ operator: "<"
30
+ value: -3.0
31
+ - indicator: "volume_ratio"
32
+ period: 5
33
+ operator: ">"
34
+ value: 3.0
35
+ logic: "any"
36
+ stop_loss: "{stop_loss}"
37
+ take_profit: "{take_profit}"
38
+
39
+ simulation:
40
+ slippage: 0.002
41
+ commission: 0.0015
42
+
43
+ position:
44
+ size: 0.5
45
+ max_positions: 1
@@ -0,0 +1,43 @@
1
+ name: "Emotion Cycle Contrarian"
2
+ version: "1.0"
3
+ description: "情绪周期逆向策略 — RSI极度超卖+缩量+布林带底部时逆向买入"
4
+
5
+ parameters:
6
+ rsi_extreme: 25
7
+ rsi_exit: 60
8
+ stop_loss: -0.07
9
+ take_profit: 0.18
10
+
11
+ entry:
12
+ conditions:
13
+ - indicator: "rsi"
14
+ period: 14
15
+ operator: "<"
16
+ value: "{rsi_extreme}"
17
+ - indicator: "volume_ratio"
18
+ period: 5
19
+ operator: "<"
20
+ value: 0.7
21
+ - indicator: "bollinger_position"
22
+ period: 20
23
+ operator: "<"
24
+ value: 0.1
25
+ logic: "all"
26
+
27
+ exit:
28
+ conditions:
29
+ - indicator: "rsi"
30
+ period: 14
31
+ operator: ">"
32
+ value: "{rsi_exit}"
33
+ - indicator: "volume_ratio"
34
+ period: 5
35
+ operator: ">"
36
+ value: 2.5
37
+ logic: "any"
38
+ stop_loss: "{stop_loss}"
39
+ take_profit: "{take_profit}"
40
+
41
+ position:
42
+ size: 0.5
43
+ max_positions: 1