@weaxs/openclaw-stock-analysis 0.1.3
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.
- package/README.md +70 -0
- package/index.ts +761 -0
- package/openclaw.plugin.json +47 -0
- package/package.json +46 -0
- package/schemas/report_schema.json +131 -0
- package/scripts/setup-python.mjs +52 -0
- package/skills/bottom-volume/SKILL.md +63 -0
- package/skills/bottom-volume/scripts/gather.py +15 -0
- package/skills/box-oscillation/SKILL.md +72 -0
- package/skills/box-oscillation/scripts/gather.py +15 -0
- package/skills/bull-trend/SKILL.md +60 -0
- package/skills/bull-trend/scripts/gather.py +15 -0
- package/skills/chan-theory/SKILL.md +71 -0
- package/skills/chan-theory/scripts/gather.py +15 -0
- package/skills/dragon-head/SKILL.md +69 -0
- package/skills/dragon-head/scripts/gather.py +15 -0
- package/skills/emotion-cycle/SKILL.md +65 -0
- package/skills/emotion-cycle/scripts/gather.py +15 -0
- package/skills/event-driven/SKILL.md +73 -0
- package/skills/event-driven/scripts/gather.py +15 -0
- package/skills/expectation-repricing/SKILL.md +72 -0
- package/skills/expectation-repricing/scripts/gather.py +15 -0
- package/skills/growth-quality/SKILL.md +74 -0
- package/skills/growth-quality/scripts/gather.py +15 -0
- package/skills/hot-theme/SKILL.md +74 -0
- package/skills/hot-theme/scripts/gather.py +15 -0
- package/skills/ma-crossover/SKILL.md +63 -0
- package/skills/ma-crossover/scripts/gather.py +15 -0
- package/skills/market-review/SKILL.md +70 -0
- package/skills/market-review/scripts/gather.py +16 -0
- package/skills/one-yang-three-yin/SKILL.md +74 -0
- package/skills/one-yang-three-yin/scripts/gather.py +15 -0
- package/skills/shrink-pullback/SKILL.md +59 -0
- package/skills/shrink-pullback/scripts/gather.py +15 -0
- package/skills/stock-analysis/SKILL.md +134 -0
- package/skills/stock-analysis/scripts/gather.py +15 -0
- package/skills/stock-screener/SKILL.md +68 -0
- package/skills/stock-screener/scripts/gather.py +15 -0
- package/skills/strategy-backtest/SKILL.md +129 -0
- package/skills/strategy-backtest/scripts/gather.py +16 -0
- package/skills/volume-breakout/SKILL.md +58 -0
- package/skills/volume-breakout/scripts/gather.py +15 -0
- package/skills/wave-theory/SKILL.md +67 -0
- package/skills/wave-theory/scripts/gather.py +15 -0
- package/skills/wisburg-research/SKILL.md +119 -0
- package/strategies/examples/bottom_volume.yaml +47 -0
- package/strategies/examples/box_oscillation.yaml +41 -0
- package/strategies/examples/bull_trend.yaml +42 -0
- package/strategies/examples/dragon_head.yaml +45 -0
- package/strategies/examples/emotion_cycle.yaml +43 -0
- package/strategies/examples/ma_crossover.yaml +34 -0
- package/strategies/examples/rsi_oversold.yaml +35 -0
- package/strategies/examples/shrink_pullback.yaml +45 -0
- package/strategies/examples/volume_breakout.yaml +42 -0
- package/tools/__init__.py +0 -0
- package/tools/anomaly_detect.py +570 -0
- package/tools/backtest.py +643 -0
- package/tools/gather.py +152 -0
- package/tools/market_regime.py +247 -0
- package/tools/market_review.py +150 -0
- package/tools/name_resolver.py +131 -0
- package/tools/pattern.py +509 -0
- package/tools/requirements.txt +13 -0
- package/tools/risk_screening.py +318 -0
- package/tools/screener.py +213 -0
- package/tools/search_intel.py +455 -0
- package/tools/stock_data.py +1649 -0
- package/tools/technical.py +636 -0
- package/tools/trading_calendar.py +198 -0
- package/tools/volume_analysis.py +172 -0
- package/tools/watchlist.py +61 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "stock-analysis",
|
|
3
|
+
"name": "Stock Analysis",
|
|
4
|
+
"description": "Stock analysis, screening, and strategy backtesting across A/HK/US markets (akshare/yfinance/tushare)",
|
|
5
|
+
"contracts": {
|
|
6
|
+
"tools": [
|
|
7
|
+
"get_kline",
|
|
8
|
+
"get_quote",
|
|
9
|
+
"get_capital_flow",
|
|
10
|
+
"get_news",
|
|
11
|
+
"get_financials",
|
|
12
|
+
"get_technical_analysis",
|
|
13
|
+
"analyze_pattern",
|
|
14
|
+
"get_market_indices",
|
|
15
|
+
"get_sector_rankings",
|
|
16
|
+
"get_stock_info",
|
|
17
|
+
"get_chip_distribution",
|
|
18
|
+
"get_market_stats",
|
|
19
|
+
"get_fundamental_context",
|
|
20
|
+
"screen_stocks",
|
|
21
|
+
"run_backtest",
|
|
22
|
+
"evaluate_signal",
|
|
23
|
+
"resolve_stock_name",
|
|
24
|
+
"check_trading_day",
|
|
25
|
+
"get_trading_days",
|
|
26
|
+
"calculate_ma",
|
|
27
|
+
"get_volume_analysis",
|
|
28
|
+
"search_stock_news",
|
|
29
|
+
"search_comprehensive_intel",
|
|
30
|
+
"get_social_sentiment",
|
|
31
|
+
"get_trending_sentiment",
|
|
32
|
+
"extract_article",
|
|
33
|
+
"screen_risk",
|
|
34
|
+
"detect_market_regime",
|
|
35
|
+
"get_market_review",
|
|
36
|
+
"run_watchlist_analysis",
|
|
37
|
+
"detect_anomaly"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"activation": {
|
|
41
|
+
"onStartup": true
|
|
42
|
+
},
|
|
43
|
+
"configSchema": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
}
|
|
47
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@weaxs/openclaw-stock-analysis",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "OpenClaw plugin for stock analysis, screening, and strategy backtesting across A/HK/US markets",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.ts",
|
|
7
|
+
"openclaw": {
|
|
8
|
+
"extensions": ["./index.ts"],
|
|
9
|
+
"compat": {
|
|
10
|
+
"pluginApi": ">=2026.3.24-beta.2",
|
|
11
|
+
"minGatewayVersion": "2026.3.24-beta.2"
|
|
12
|
+
},
|
|
13
|
+
"build": {
|
|
14
|
+
"openclawVersion": "2026.3.24-beta.2",
|
|
15
|
+
"pluginSdkVersion": "2026.3.24-beta.2"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"postinstall": "node scripts/setup-python.mjs"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"index.ts",
|
|
23
|
+
"openclaw.plugin.json",
|
|
24
|
+
"README.md",
|
|
25
|
+
"tools/",
|
|
26
|
+
"skills/",
|
|
27
|
+
"schemas/",
|
|
28
|
+
"strategies/",
|
|
29
|
+
"scripts/"
|
|
30
|
+
],
|
|
31
|
+
"keywords": [
|
|
32
|
+
"openclaw",
|
|
33
|
+
"openclaw-plugin",
|
|
34
|
+
"stock-analysis",
|
|
35
|
+
"stock-screener",
|
|
36
|
+
"backtest",
|
|
37
|
+
"a-shares",
|
|
38
|
+
"hk-stocks",
|
|
39
|
+
"us-stocks"
|
|
40
|
+
],
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "https://github.com/Weaxs/stock-analysis-plugin"
|
|
44
|
+
},
|
|
45
|
+
"license": "MIT"
|
|
46
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "StockAnalysisReport",
|
|
4
|
+
"description": "结构化股票分析报告格式",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"stock_name": { "type": "string" },
|
|
8
|
+
"stock_code": { "type": "string" },
|
|
9
|
+
"analysis_date": { "type": "string", "format": "date" },
|
|
10
|
+
"sentiment_score": {
|
|
11
|
+
"type": "integer", "minimum": 0, "maximum": 100,
|
|
12
|
+
"description": "综合情绪分(0看空-100看多)"
|
|
13
|
+
},
|
|
14
|
+
"decision_type": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": ["strong_buy", "buy", "hold", "sell", "strong_sell"]
|
|
17
|
+
},
|
|
18
|
+
"confidence": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": ["high", "medium", "low"]
|
|
21
|
+
},
|
|
22
|
+
"core_conclusion": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"one_sentence": { "type": "string", "description": "一句话核心结论" },
|
|
26
|
+
"signal_type": { "type": "string" },
|
|
27
|
+
"time_sensitivity": { "type": "string", "description": "时效性(当日/本周/中期)" },
|
|
28
|
+
"position_advice": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"no_position": { "type": "string", "description": "空仓者建议" },
|
|
32
|
+
"has_position": { "type": "string", "description": "持仓者建议" }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"market_environment": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"description": "当前市场环境(来自 detect_market_regime)",
|
|
40
|
+
"properties": {
|
|
41
|
+
"regime": { "type": "string" },
|
|
42
|
+
"regime_cn": { "type": "string" },
|
|
43
|
+
"confidence": { "type": "number" },
|
|
44
|
+
"recommended_skills": { "type": "array", "items": { "type": "string" } }
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"risk_screening": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"description": "风险筛查结果(来自 screen_risk)",
|
|
50
|
+
"properties": {
|
|
51
|
+
"risk_level": { "type": "string", "enum": ["low", "medium", "high"] },
|
|
52
|
+
"risk_score": { "type": "integer", "minimum": 0, "maximum": 100 },
|
|
53
|
+
"veto_buy": { "type": "boolean" },
|
|
54
|
+
"flags": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"properties": {
|
|
59
|
+
"category": { "type": "string" },
|
|
60
|
+
"severity": { "type": "string" },
|
|
61
|
+
"description": { "type": "string" }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"data_perspective": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"properties": {
|
|
70
|
+
"trend_status": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"ma_alignment": { "type": "string" },
|
|
74
|
+
"is_bullish": { "type": "boolean" },
|
|
75
|
+
"trend_score": { "type": "number" }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"price_position": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"properties": {
|
|
81
|
+
"current_price": { "type": "number" },
|
|
82
|
+
"bias_ma5": { "type": "number" },
|
|
83
|
+
"support_level": { "type": "number" },
|
|
84
|
+
"resistance_level": { "type": "number" }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"volume_analysis": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"properties": {
|
|
90
|
+
"volume_ratio": { "type": "number" },
|
|
91
|
+
"volume_status": { "type": "string" },
|
|
92
|
+
"turnover_rate": { "type": "number" }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"chip_structure": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"properties": {
|
|
98
|
+
"profit_ratio": { "type": "number" },
|
|
99
|
+
"avg_cost": { "type": "number" },
|
|
100
|
+
"concentration": { "type": "number" }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"intelligence": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"latest_news": { "type": "string" },
|
|
109
|
+
"risk_alerts": { "type": "array", "items": { "type": "string" } },
|
|
110
|
+
"positive_catalysts": { "type": "array", "items": { "type": "string" } },
|
|
111
|
+
"sentiment_summary": { "type": "string" }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"battle_plan": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"properties": {
|
|
117
|
+
"ideal_buy": { "type": ["number", "string"] },
|
|
118
|
+
"secondary_buy": { "type": ["number", "string"] },
|
|
119
|
+
"stop_loss": { "type": ["number", "string"] },
|
|
120
|
+
"take_profit": { "type": ["number", "string"] },
|
|
121
|
+
"suggested_position": { "type": "string" },
|
|
122
|
+
"entry_plan": { "type": "string" },
|
|
123
|
+
"risk_control": { "type": "string" },
|
|
124
|
+
"action_checklist": { "type": "array", "items": { "type": "string" } }
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"risk_warning": { "type": "array", "items": { "type": "string" } }
|
|
128
|
+
},
|
|
129
|
+
"required": ["stock_name", "stock_code", "analysis_date", "sentiment_score",
|
|
130
|
+
"decision_type", "confidence", "core_conclusion"]
|
|
131
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execSync } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
|
|
6
|
+
const pkgDir = new URL("..", import.meta.url).pathname.replace(/\/$/, "");
|
|
7
|
+
const isWin = process.platform === "win32";
|
|
8
|
+
const venvDir = join(pkgDir, ".venv");
|
|
9
|
+
const pip = join(venvDir, isWin ? "Scripts" : "bin", "pip");
|
|
10
|
+
const requirements = join(pkgDir, "tools", "requirements.txt");
|
|
11
|
+
|
|
12
|
+
function run(cmd) {
|
|
13
|
+
execSync(cmd, { stdio: "pipe", timeout: 300_000 });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function findPython() {
|
|
17
|
+
for (const name of ["python3", "python"]) {
|
|
18
|
+
try {
|
|
19
|
+
const ver = execSync(`${name} --version`, { stdio: "pipe" }).toString().trim();
|
|
20
|
+
const match = ver.match(/(\d+)\.(\d+)/);
|
|
21
|
+
if (match && (parseInt(match[1]) > 3 || (parseInt(match[1]) === 3 && parseInt(match[2]) >= 9))) {
|
|
22
|
+
return name;
|
|
23
|
+
}
|
|
24
|
+
} catch {}
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const python = findPython();
|
|
31
|
+
if (!python) {
|
|
32
|
+
console.warn(
|
|
33
|
+
"\n[pi-stock-analysis] python3 >= 3.9 not found.\n" +
|
|
34
|
+
"Install Python 3.9+ and re-run: npm rebuild pi-stock-analysis\n"
|
|
35
|
+
);
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!existsSync(venvDir)) {
|
|
40
|
+
run(`${python} -m venv "${venvDir}"`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (existsSync(requirements)) {
|
|
44
|
+
run(`"${pip}" install -q -r "${requirements}"`);
|
|
45
|
+
}
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.warn(
|
|
48
|
+
`\n[pi-stock-analysis] Python setup failed: ${err.message}\n` +
|
|
49
|
+
"You can manually run: python3 -m venv .venv && .venv/bin/pip install -r tools/requirements.txt\n"
|
|
50
|
+
);
|
|
51
|
+
process.exit(0);
|
|
52
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bottom-volume
|
|
3
|
+
description: 底部放量策略 — 识别底部区域的异动放量信号。当用户要求分析底部放量时使用。
|
|
4
|
+
allowed-tools: Bash(python3:*) Read
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 底部放量分析
|
|
8
|
+
|
|
9
|
+
你是一位专注底部形态的交易专家。
|
|
10
|
+
|
|
11
|
+
## 核心理念
|
|
12
|
+
|
|
13
|
+
长期下跌后的底部区域出现异常放量,可能意味着主力资金开始建仓。底部放量是趋势反转的先兆信号,但需要结合其他指标确认。
|
|
14
|
+
|
|
15
|
+
## 执行流程
|
|
16
|
+
|
|
17
|
+
### 1. 采集数据
|
|
18
|
+
|
|
19
|
+
运行数据采集脚本获取 120 根日K线及技术指标:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python3 scripts/gather.py <symbol>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. 底部区域确认
|
|
26
|
+
|
|
27
|
+
**底部特征**:
|
|
28
|
+
- 价格距离近 60 日高点下跌 >20%
|
|
29
|
+
- 股价运行在 MA60 下方较长时间
|
|
30
|
+
- RSI 处于低位区间(<40)
|
|
31
|
+
- 布林带开口收窄,股价在下轨附近
|
|
32
|
+
- KDJ 在超卖区域
|
|
33
|
+
|
|
34
|
+
### 3. 底部放量类型
|
|
35
|
+
|
|
36
|
+
| 类型 | 量价特征 | 信号强度 |
|
|
37
|
+
|------|----------|----------|
|
|
38
|
+
| 底部温和放量 | 量比 1.5-2.5,小阳线 | 中等,可能是试探性建仓 |
|
|
39
|
+
| 底部巨量阳线 | 量比 >3,大阳线 | 强,主力大举建仓 |
|
|
40
|
+
| 底部放量十字星 | 量比 >2,十字星 | 变盘信号,需观察后续 |
|
|
41
|
+
| 底部放量长下影 | 量比 >2,长下影线 | 强支撑,有资金承接 |
|
|
42
|
+
|
|
43
|
+
### 4. 确认信号
|
|
44
|
+
|
|
45
|
+
单日放量不够,还需要:
|
|
46
|
+
- 后续几日成交量维持在均量之上
|
|
47
|
+
- 价格站上 MA5 并上攻 MA10
|
|
48
|
+
- MACD 在底部金叉
|
|
49
|
+
- 不出现放量大阴线(那是出货不是建仓)
|
|
50
|
+
|
|
51
|
+
### 5. 注意事项
|
|
52
|
+
|
|
53
|
+
- 底部放量后可能还有二次探底
|
|
54
|
+
- 区分"放量见底"和"放量破位"(放量跌破重要支撑是加速下跌)
|
|
55
|
+
- 建议分批建仓而非一次满仓
|
|
56
|
+
|
|
57
|
+
## 输出要求
|
|
58
|
+
|
|
59
|
+
1. 是否处于底部区域(下跌幅度、持续时间)
|
|
60
|
+
2. 是否出现底部放量信号
|
|
61
|
+
3. 放量类型及信号强度
|
|
62
|
+
4. 后续确认情况
|
|
63
|
+
5. 建仓建议(分批价位、止损位)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Gather technical data for bottom-volume analysis."""
|
|
3
|
+
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
tools = Path(__file__).resolve().parents[2] / "tools"
|
|
9
|
+
result = subprocess.run(
|
|
10
|
+
[sys.executable, str(tools / "gather.py"), "technical", sys.argv[1], "--kline-count", "120"],
|
|
11
|
+
capture_output=True,
|
|
12
|
+
text=True,
|
|
13
|
+
)
|
|
14
|
+
sys.stdout.write(result.stdout)
|
|
15
|
+
sys.exit(result.returncode)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: box-oscillation
|
|
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
|
+
**箱体形成条件**:
|
|
28
|
+
- 价格在一段时间(>20个交易日)内有至少 2 次触及上沿和下沿
|
|
29
|
+
- 上沿和下沿各自的偏差 <3%(高低点相近)
|
|
30
|
+
- 箱体宽度(振幅)在 8%-25% 之间为理想
|
|
31
|
+
- 布林带开口收窄,带宽 <15%
|
|
32
|
+
|
|
33
|
+
**箱体参数**:
|
|
34
|
+
- 上沿:区间内多个高点的均值
|
|
35
|
+
- 下沿:区间内多个低点的均值
|
|
36
|
+
- 中轴:(上沿 + 下沿) / 2
|
|
37
|
+
|
|
38
|
+
### 3. 箱体内操作
|
|
39
|
+
|
|
40
|
+
**买入区域**:箱体下沿 ~ 下沿 + 箱体宽度 * 20%
|
|
41
|
+
- 确认信号:触及下沿后出现阳线、成交量萎缩
|
|
42
|
+
- RSI 进入低位区间(<40)
|
|
43
|
+
|
|
44
|
+
**卖出区域**:箱体上沿 - 箱体宽度 * 20% ~ 上沿
|
|
45
|
+
- 确认信号:触及上沿后出现阴线、成交量放大
|
|
46
|
+
- RSI 进入高位区间(>60)
|
|
47
|
+
|
|
48
|
+
### 4. 箱体突破
|
|
49
|
+
|
|
50
|
+
**向上突破**:
|
|
51
|
+
- 放量突破上沿(量比 >2)
|
|
52
|
+
- 收盘站上上沿
|
|
53
|
+
- 目标位 = 上沿 + 箱体宽度
|
|
54
|
+
|
|
55
|
+
**向下突破**:
|
|
56
|
+
- 放量跌破下沿
|
|
57
|
+
- 收盘跌破下沿
|
|
58
|
+
- 止损离场
|
|
59
|
+
|
|
60
|
+
### 5. 风险控制
|
|
61
|
+
|
|
62
|
+
- 止损位:箱体下沿下方 2%-3%
|
|
63
|
+
- 每次箱体内波段操作仓位不超过 50%
|
|
64
|
+
- 箱体越窄(<8%),假突破概率越大
|
|
65
|
+
|
|
66
|
+
## 输出要求
|
|
67
|
+
|
|
68
|
+
1. 是否处于箱体震荡状态
|
|
69
|
+
2. 箱体上沿、下沿、中轴价位
|
|
70
|
+
3. 当前价格在箱体中的位置
|
|
71
|
+
4. 操作建议(买入/卖出/观望/突破追踪)
|
|
72
|
+
5. 关键价位和止损设置
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Gather technical data for box-oscillation analysis."""
|
|
3
|
+
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
tools = Path(__file__).resolve().parents[2] / "tools"
|
|
9
|
+
result = subprocess.run(
|
|
10
|
+
[sys.executable, str(tools / "gather.py"), "technical", sys.argv[1], "--kline-count", "90"],
|
|
11
|
+
capture_output=True,
|
|
12
|
+
text=True,
|
|
13
|
+
)
|
|
14
|
+
sys.stdout.write(result.stdout)
|
|
15
|
+
sys.exit(result.returncode)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bull-trend
|
|
3
|
+
description: 趋势追踪策略 — 识别并跟随中长期上升趋势。当用户要求趋势分析时使用。
|
|
4
|
+
allowed-tools: Bash(python3:*) Read
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 趋势追踪分析
|
|
8
|
+
|
|
9
|
+
你是一位趋势交易专家。运用趋势追踪方法论分析股票。
|
|
10
|
+
|
|
11
|
+
## 核心理念
|
|
12
|
+
|
|
13
|
+
趋势追踪的核心是"顺势而为"——在确认趋势形成后入场,在趋势转弱时离场。不预测顶底,只跟随趋势。
|
|
14
|
+
|
|
15
|
+
## 执行流程
|
|
16
|
+
|
|
17
|
+
### 1. 采集数据
|
|
18
|
+
|
|
19
|
+
运行数据采集脚本获取 120 根日K线及技术指标:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python3 scripts/gather.py <symbol>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. 趋势确认
|
|
26
|
+
|
|
27
|
+
**多头趋势确认条件**:
|
|
28
|
+
- 均线多头排列:MA5 > MA10 > MA20 > MA60
|
|
29
|
+
- MACD 在零轴之上运行
|
|
30
|
+
- 价格沿着上升通道运行
|
|
31
|
+
- 每次回调不破前低
|
|
32
|
+
|
|
33
|
+
**空头趋势确认条件**:
|
|
34
|
+
- 均线空头排列:MA5 < MA10 < MA20 < MA60
|
|
35
|
+
- MACD 在零轴之下运行
|
|
36
|
+
- 价格沿下降通道运行
|
|
37
|
+
|
|
38
|
+
### 3. 趋势阶段判断
|
|
39
|
+
|
|
40
|
+
| 阶段 | 特征 | 操作 |
|
|
41
|
+
|------|------|------|
|
|
42
|
+
| 启动期 | 均线粘合后向上发散,放量突破 | 建仓 |
|
|
43
|
+
| 加速期 | 价格加速上涨,远离均线 | 持有,注意高位风险 |
|
|
44
|
+
| 成熟期 | 涨幅放缓,量能递减 | 逐步减仓 |
|
|
45
|
+
| 衰退期 | 跌破 MA20 或趋势线 | 清仓 |
|
|
46
|
+
|
|
47
|
+
### 4. 关键指标
|
|
48
|
+
|
|
49
|
+
- **ADX 替代**:用 MA 斜率和排列程度衡量趋势强度
|
|
50
|
+
- **趋势线**:连接近期低点作为上升趋势线
|
|
51
|
+
- **回调幅度**:健康回调通常不超过前一波涨幅的 38.2%-50%
|
|
52
|
+
|
|
53
|
+
## 输出要求
|
|
54
|
+
|
|
55
|
+
分析完成后输出:
|
|
56
|
+
1. 当前趋势方向和阶段
|
|
57
|
+
2. 趋势强度评分(1-10)
|
|
58
|
+
3. 关键趋势支撑/压力位
|
|
59
|
+
4. 入场/持有/离场建议
|
|
60
|
+
5. 止损位建议
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Gather technical data for bull-trend analysis."""
|
|
3
|
+
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
tools = Path(__file__).resolve().parents[2] / "tools"
|
|
9
|
+
result = subprocess.run(
|
|
10
|
+
[sys.executable, str(tools / "gather.py"), "technical", sys.argv[1], "--kline-count", "120"],
|
|
11
|
+
capture_output=True,
|
|
12
|
+
text=True,
|
|
13
|
+
)
|
|
14
|
+
sys.stdout.write(result.stdout)
|
|
15
|
+
sys.exit(result.returncode)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chan-theory
|
|
3
|
+
description: 缠论分析 — 基于缠中说禅理论的笔、段、中枢分析。当用户要求缠论分析时使用。
|
|
4
|
+
allowed-tools: Bash(python3:*) Read
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 缠论分析
|
|
8
|
+
|
|
9
|
+
你是一位精通缠论的交易专家。运用缠中说禅理论体系分析股票走势。
|
|
10
|
+
|
|
11
|
+
## 核心理念
|
|
12
|
+
|
|
13
|
+
缠论是一套完备的技术分析理论,通过对走势的几何结构分析(笔→段→中枢→趋势),实现精确的买卖点定位。
|
|
14
|
+
|
|
15
|
+
## 执行流程
|
|
16
|
+
|
|
17
|
+
### 1. 采集数据
|
|
18
|
+
|
|
19
|
+
运行数据采集脚本获取 120 根日K线及技术指标:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python3 scripts/gather.py <symbol>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. 基本结构识别
|
|
26
|
+
|
|
27
|
+
**笔(Bi)**:
|
|
28
|
+
- 相邻的顶底分型之间,至少包含 5 根K线
|
|
29
|
+
- 顶分型:中间K线最高价最高
|
|
30
|
+
- 底分型:中间K线最低价最低
|
|
31
|
+
- 分析近期的上升笔和下降笔
|
|
32
|
+
|
|
33
|
+
**段(Duan)**:
|
|
34
|
+
- 至少 3 笔构成
|
|
35
|
+
- 同方向笔的延续
|
|
36
|
+
- 段的方向决定了中级别趋势
|
|
37
|
+
|
|
38
|
+
**中枢(ZhongShu)**:
|
|
39
|
+
- 至少 3 段重叠区域
|
|
40
|
+
- 中枢 = [max(底), min(顶)] 的重叠部分
|
|
41
|
+
- 中枢代表多空平衡区域
|
|
42
|
+
|
|
43
|
+
### 3. 买卖点判断
|
|
44
|
+
|
|
45
|
+
**第一类买点**:趋势背驰(下跌趋势中,最后一段相对前一段出现背驰)
|
|
46
|
+
- MACD 绿柱面积递减
|
|
47
|
+
- 创新低但力度减弱
|
|
48
|
+
|
|
49
|
+
**第二类买点**:中枢后第一次回抽不进中枢
|
|
50
|
+
- 强于第一类买点
|
|
51
|
+
- 确认中枢的突破有效
|
|
52
|
+
|
|
53
|
+
**第三类买点**:离开中枢后回抽不进中枢
|
|
54
|
+
- 趋势延续信号
|
|
55
|
+
- 最安全的买点
|
|
56
|
+
|
|
57
|
+
**卖点**:与买点对称反向
|
|
58
|
+
|
|
59
|
+
### 4. 背驰判断
|
|
60
|
+
|
|
61
|
+
- **趋势背驰**:用 MACD 面积比较
|
|
62
|
+
- **盘整背驰**:中枢震荡中的背驰
|
|
63
|
+
- 背驰 ≠ 一定转折,但转折必须背驰
|
|
64
|
+
|
|
65
|
+
## 输出要求
|
|
66
|
+
|
|
67
|
+
1. 当前走势的缠论结构(笔、段、中枢)
|
|
68
|
+
2. 中枢的位置和区间
|
|
69
|
+
3. 是否出现背驰信号
|
|
70
|
+
4. 最近的买卖点类型和位置
|
|
71
|
+
5. 后续走势的缠论推演(可能的几种路径)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Gather technical data for chan-theory analysis."""
|
|
3
|
+
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
tools = Path(__file__).resolve().parents[2] / "tools"
|
|
9
|
+
result = subprocess.run(
|
|
10
|
+
[sys.executable, str(tools / "gather.py"), "technical", sys.argv[1], "--kline-count", "120"],
|
|
11
|
+
capture_output=True,
|
|
12
|
+
text=True,
|
|
13
|
+
)
|
|
14
|
+
sys.stdout.write(result.stdout)
|
|
15
|
+
sys.exit(result.returncode)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dragon-head
|
|
3
|
+
description: 龙头战法 — 识别板块龙头股和领涨个股。当用户要求龙头股分析时使用。
|
|
4
|
+
allowed-tools: Bash(python3:*) Read
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 龙头战法分析
|
|
8
|
+
|
|
9
|
+
你是一位专注龙头股战法的交易专家。
|
|
10
|
+
|
|
11
|
+
## 核心理念
|
|
12
|
+
|
|
13
|
+
每一轮板块行情都有龙头股引领。龙头股具有最强的市场号召力、最大的涨幅空间。龙头战法的核心是"抓龙头、弃杂毛"——只做板块中最强的那只。
|
|
14
|
+
|
|
15
|
+
## 执行流程
|
|
16
|
+
|
|
17
|
+
### 1. 采集数据
|
|
18
|
+
|
|
19
|
+
运行数据采集脚本获取 30 根日K线、技术指标及实时行情:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python3 scripts/gather.py <symbol>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. 龙头股特征识别
|
|
26
|
+
|
|
27
|
+
**一字特征**(最强龙头):
|
|
28
|
+
- 率先涨停或封单最大
|
|
29
|
+
- 板块启动第一天就涨停
|
|
30
|
+
- 连板天数最多
|
|
31
|
+
|
|
32
|
+
**量价特征**:
|
|
33
|
+
- 涨幅领先同板块个股
|
|
34
|
+
- 成交量换手率适中(不过分大也不过分小)
|
|
35
|
+
- 连续上涨期间回调幅度最小
|
|
36
|
+
|
|
37
|
+
**市场地位**:
|
|
38
|
+
- 具有板块辨识度(一提到某概念就想到这只股)
|
|
39
|
+
- 市值不宜过大(难以拉升)也不宜过小(承载力不够)
|
|
40
|
+
|
|
41
|
+
### 3. 龙头战法操作
|
|
42
|
+
|
|
43
|
+
**买入时机**:
|
|
44
|
+
- 板块启动初期,第 1-2 个涨停板
|
|
45
|
+
- 首次分歧日(换手充分后再度走强)
|
|
46
|
+
- 强势股回调至 5 日线附近
|
|
47
|
+
|
|
48
|
+
**卖出时机**:
|
|
49
|
+
- 连板结束后的第一个大阴线
|
|
50
|
+
- 板块整体退潮,跟风股全面走弱
|
|
51
|
+
- 换手率异常放大(超过前几日均值 3 倍以上)
|
|
52
|
+
|
|
53
|
+
### 4. 龙头 vs 跟风
|
|
54
|
+
|
|
55
|
+
| 特征 | 龙头 | 跟风 |
|
|
56
|
+
|------|------|------|
|
|
57
|
+
| 启动顺序 | 最先 | 滞后 |
|
|
58
|
+
| 涨幅 | 最大 | 较小 |
|
|
59
|
+
| 回调 | 小且快 | 大且深 |
|
|
60
|
+
| 封板 | 坚决 | 反复开板 |
|
|
61
|
+
| 持续性 | 强 | 弱 |
|
|
62
|
+
|
|
63
|
+
## 输出要求
|
|
64
|
+
|
|
65
|
+
1. 个股是否具备龙头特征
|
|
66
|
+
2. 所属板块和板块热度
|
|
67
|
+
3. 与同板块个股的强弱对比
|
|
68
|
+
4. 当前处于龙头行情的哪个阶段
|
|
69
|
+
5. 操作建议和风险提示
|