Cross Market Indicators — 跨市场技术指标
所有接口均为 V2 版本(/api/v2/...)。
Curl Setup
BASE="http://43.167.234.49:3101"
AUTH=(-H "X-API-Key: 123456" -H "Content-Type: application/json")
代码格式规则
| 规则 |
值 |
market |
必填:cn(A股), hk(港股), us(美股) |
symbol |
按市场对应格式 |
| 日期格式 |
YYYY-MM-DD(⚠️ 注意:与其他端点的 YYYYMMDD 不同) |
| 市场 |
market |
symbol 格式 |
示例 |
| A股 |
cn |
带后缀 |
600519.SH |
| 港股 |
hk |
带 .HK |
00700.HK |
| 美股 |
us |
Ticker |
AAPL |
支持的指标(27种)
| # |
Indicator |
Type |
Key Parameters |
Default |
| 1 |
SMA |
Trend |
period |
20 |
| 2 |
EMA |
Trend |
period |
20 |
| 3 |
RSI |
Oscillator |
period |
14 |
| 4 |
MACD |
Trend |
fast_period, slow_period, signal_period |
12, 26, 9 |
| 5 |
BOLL |
Volatility |
period, nbdev |
20, 2.0 |
| 6 |
KDJ |
Oscillator |
fastk_period, slowk_period, slowd_period |
9, 3, 3 |
| 7 |
ADX |
Trend |
period |
14 |
| 8 |
ATR |
Volatility |
period |
14 |
| 9 |
CCI |
Oscillator |
period |
14 |
| 10 |
VWAP |
Volume |
period |
20 |
| 11 |
OBV |
Volume |
无 |
— |
| 12 |
NATR |
Volatility |
period |
14 |
| 13 |
MFI |
Volume |
period |
14 |
| 14 |
WILLR |
Oscillator |
period |
14 |
| 15 |
STDDEV |
Volatility |
period |
20 |
| 16 |
Aroon |
Trend |
period |
14 |
| 17 |
TRIX |
Trend |
period |
9 |
| 18 |
MOM |
Momentum |
period |
10 |
| 19 |
ROC |
Momentum |
period |
12 |
| 20 |
CMO |
Momentum |
period |
14 |
| 21 |
AD |
Volume |
无 |
— |
| 22 |
HT Trendline |
Trend |
无 |
— |
| 23 |
PPO |
Trend |
fast_period, slow_period |
12, 26 |
| 24 |
SAR |
Trend |
acceleration, maximum |
0.02, 0.2 |
| 25 |
Stoch |
Oscillator |
k_period, d_period, smooth_period |
14, 3, 3 |
| 26 |
ULTOSC |
Oscillator |
period1, period2, period3 |
7, 14, 28 |
| 27 |
ADOSC |
Volume |
fast_period, slow_period |
3, 10 |
端点详情
POST /api/v2/indicators/batch — 批量指标(推荐)
一次请求计算多个指标,禁止逐个调用单指标端点。
| Parameter |
Type |
Required |
Default |
Description |
market |
string |
Yes |
— |
cn, hk, us |
symbol |
string |
Yes |
— |
股票代码 |
interval |
string |
No |
1d |
1m, 5m, 15m, 1h, 4h, 1d, 1w |
limit |
int |
No |
100 |
记录数上限 |
start |
string |
No |
— |
起始日期 YYYY-MM-DD |
end |
string |
No |
— |
结束日期 YYYY-MM-DD |
indicators |
array |
Yes |
— |
指标列表 |
indicators 数组中每项:
| Field |
Type |
Required |
Description |
type |
string |
Yes |
指标类型(小写) |
params |
array |
No |
指标参数 |
GET /api/v2/indicators/{type} — 单指标
| Parameter |
Type |
Required |
Description |
market |
string |
Yes |
cn, hk, us |
symbol |
string |
Yes |
股票代码 |
interval |
string |
No |
默认 1d |
period |
int |
No |
周期参数 |
limit |
int |
No |
默认 100 |
GET /api/v2/indicators/info — 指标信息查询
无参数。
Batch Params 映射
| Indicator |
params |
示例 |
| sma, ema, rsi, atr, cci, vwap, natr, mfi, willr, stddev, aroon, trix |
[period] |
[14] |
| mom, roc, cmo |
[period] |
[10] |
| macd |
[fast, slow, signal] |
[12, 26, 9] |
| boll |
[period, nbdev] |
[20, 2.0] |
| kdj |
[fastk, slowk, slowd] |
[9, 3, 3] |
| ppo, adosc |
[fast, slow] |
[12, 26] |
| sar |
[acceleration, maximum] |
[0.02, 0.2] |
| stoch |
[k, d, smooth] |
[14, 3, 3] |
| ultosc |
[period1, period2, period3] |
[7, 14, 28] |
| obv, ad, ht_trendline |
无 params |
省略 |
调用示例
批量接口(推荐)
# A股:RSI + MACD + BOLL + KDJ
curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/indicators/batch" -d '{
"market": "cn",
"symbol": "000001.SZ",
"interval": "1d",
"limit": 100,
"indicators": [
{"type": "rsi", "params": [14]},
{"type": "macd", "params": [12, 26, 9]},
{"type": "boll", "params": [20, 2.0]},
{"type": "kdj", "params": [9, 3, 3]}
]
}'
# 港股:MACD + SMA
curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/indicators/batch" -d '{
"market": "hk",
"symbol": "00700.HK",
"interval": "1d",
"limit": 100,
"indicators": [
{"type": "macd", "params": [12, 26, 9]},
{"type": "sma", "params": [20]}
]
}'
# 美股:BOLL
curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/indicators/batch" -d '{
"market": "us",
"symbol": "AAPL",
"interval": "1d",
"limit": 100,
"indicators": [
{"type": "boll", "params": [20, 2.0]}
]
}'
单指标接口
# A股 RSI
curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/rsi?market=cn&symbol=000001.SZ&interval=1d&period=14&limit=100"
# 港股 MACD
curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/macd?market=hk&symbol=00700.HK&interval=1d&fast_period=12&slow_period=26&signal_period=9&limit=100"
# 美股 BOLL
curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/boll?market=us&symbol=AAPL&interval=1d&period=20&nbdev=2.0&limit=100"
# 无参数指标:OBV
curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/obv?market=cn&symbol=000001.SZ&interval=1d&limit=100"
# 指标信息
curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/info"
错误排查
| 错误 |
原因 |
修复 |
| 400 (缺 market) |
market 必填 |
加上 market: cn/hk/us |
| 400 (日期格式) |
用了 YYYYMMDD |
指标端点用 YYYY-MM-DD |
| BOLL 结果错误 |
V1 习惯 nbdev_up/nbdev_dn |
V2 用单个 nbdev(默认 2.0) |
| 404 |
指标类型拼写错误 |
小写:rsi, macd, boll |
1---2name: cross-market-indicators3description: 跨市场股票技术指标服务。支持 A股/港股/美股 27种技术指标,包括 MA/EMA/RSI/MACD/KDJ/布林带/ADX/ATR/CCI/VWAP等。 当用户询问"RSI""MACD""布林带""技术指标""KDJ""OBV"等时触发。 ⚠️ 加密货币技术指标请使用 crypto-indicators skill。4---56# Cross Market Indicators — 跨市场技术指标78> 所有接口均为 V2 版本(`/api/v2/...`)。910## Curl Setup1112```bash13BASE="http://43.167.234.49:3101"14AUTH=(-H "X-API-Key: 123456" -H "Content-Type: application/json")15```1617---1819## 代码格式规则2021| 规则 | 值 |22|------|-----|23| `market` | **必填**:`cn`(A股), `hk`(港股), `us`(美股) |24| `symbol` | 按市场对应格式 |25| 日期格式 | `YYYY-MM-DD`(⚠️ 注意:与其他端点的 `YYYYMMDD` 不同) |2627| 市场 | `market` | `symbol` 格式 | 示例 |28|------|----------|--------------|------|29| A股 | `cn` | 带后缀 | `600519.SH` |30| 港股 | `hk` | 带 .HK | `00700.HK` |31| 美股 | `us` | Ticker | `AAPL` |3233---3435## 支持的指标(27种)3637| # | Indicator | Type | Key Parameters | Default |38|---|-----------|------|----------------|---------|39| 1 | SMA | Trend | `period` | 20 |40| 2 | EMA | Trend | `period` | 20 |41| 3 | RSI | Oscillator | `period` | 14 |42| 4 | MACD | Trend | `fast_period`, `slow_period`, `signal_period` | 12, 26, 9 |43| 5 | BOLL | Volatility | `period`, `nbdev` | 20, 2.0 |44| 6 | KDJ | Oscillator | `fastk_period`, `slowk_period`, `slowd_period` | 9, 3, 3 |45| 7 | ADX | Trend | `period` | 14 |46| 8 | ATR | Volatility | `period` | 14 |47| 9 | CCI | Oscillator | `period` | 14 |48| 10 | VWAP | Volume | `period` | 20 |49| 11 | OBV | Volume | 无 | — |50| 12 | NATR | Volatility | `period` | 14 |51| 13 | MFI | Volume | `period` | 14 |52| 14 | WILLR | Oscillator | `period` | 14 |53| 15 | STDDEV | Volatility | `period` | 20 |54| 16 | Aroon | Trend | `period` | 14 |55| 17 | TRIX | Trend | `period` | 9 |56| 18 | MOM | Momentum | `period` | 10 |57| 19 | ROC | Momentum | `period` | 12 |58| 20 | CMO | Momentum | `period` | 14 |59| 21 | AD | Volume | 无 | — |60| 22 | HT Trendline | Trend | 无 | — |61| 23 | PPO | Trend | `fast_period`, `slow_period` | 12, 26 |62| 24 | SAR | Trend | `acceleration`, `maximum` | 0.02, 0.2 |63| 25 | Stoch | Oscillator | `k_period`, `d_period`, `smooth_period` | 14, 3, 3 |64| 26 | ULTOSC | Oscillator | `period1`, `period2`, `period3` | 7, 14, 28 |65| 27 | ADOSC | Volume | `fast_period`, `slow_period` | 3, 10 |6667---6869## 端点详情7071### POST /api/v2/indicators/batch — 批量指标(推荐)7273一次请求计算多个指标,**禁止逐个调用单指标端点**。7475| Parameter | Type | Required | Default | Description |76|-----------|------|----------|---------|-------------|77| `market` | string | **Yes** | — | `cn`, `hk`, `us` |78| `symbol` | string | **Yes** | — | 股票代码 |79| `interval` | string | No | `1d` | `1m`, `5m`, `15m`, `1h`, `4h`, `1d`, `1w` |80| `limit` | int | No | `100` | 记录数上限 |81| `start` | string | No | — | 起始日期 **YYYY-MM-DD** |82| `end` | string | No | — | 结束日期 **YYYY-MM-DD** |83| `indicators` | array | **Yes** | — | 指标列表 |8485**indicators 数组中每项**:8687| Field | Type | Required | Description |88|-------|------|----------|-------------|89| `type` | string | **Yes** | 指标类型(小写) |90| `params` | array | No | 指标参数 |9192### GET /api/v2/indicators/{type} — 单指标9394| Parameter | Type | Required | Description |95|-----------|------|----------|-------------|96| `market` | string | **Yes** | `cn`, `hk`, `us` |97| `symbol` | string | **Yes** | 股票代码 |98| `interval` | string | No | 默认 `1d` |99| `period` | int | No | 周期参数 |100| `limit` | int | No | 默认 100 |101102### GET /api/v2/indicators/info — 指标信息查询103104无参数。105106---107108## Batch Params 映射109110| Indicator | params | 示例 |111|-----------|--------|------|112| sma, ema, rsi, atr, cci, vwap, natr, mfi, willr, stddev, aroon, trix | `[period]` | `[14]` |113| mom, roc, cmo | `[period]` | `[10]` |114| macd | `[fast, slow, signal]` | `[12, 26, 9]` |115| boll | `[period, nbdev]` | `[20, 2.0]` |116| kdj | `[fastk, slowk, slowd]` | `[9, 3, 3]` |117| ppo, adosc | `[fast, slow]` | `[12, 26]` |118| sar | `[acceleration, maximum]` | `[0.02, 0.2]` |119| stoch | `[k, d, smooth]` | `[14, 3, 3]` |120| ultosc | `[period1, period2, period3]` | `[7, 14, 28]` |121| obv, ad, ht_trendline | 无 params | 省略 |122123---124125## 调用示例126127### 批量接口(推荐)128129```bash130# A股:RSI + MACD + BOLL + KDJ131curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/indicators/batch" -d '{132 "market": "cn",133 "symbol": "000001.SZ",134 "interval": "1d",135 "limit": 100,136 "indicators": [137 {"type": "rsi", "params": [14]},138 {"type": "macd", "params": [12, 26, 9]},139 {"type": "boll", "params": [20, 2.0]},140 {"type": "kdj", "params": [9, 3, 3]}141 ]142}'143144# 港股:MACD + SMA145curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/indicators/batch" -d '{146 "market": "hk",147 "symbol": "00700.HK",148 "interval": "1d",149 "limit": 100,150 "indicators": [151 {"type": "macd", "params": [12, 26, 9]},152 {"type": "sma", "params": [20]}153 ]154}'155156# 美股:BOLL157curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/indicators/batch" -d '{158 "market": "us",159 "symbol": "AAPL",160 "interval": "1d",161 "limit": 100,162 "indicators": [163 {"type": "boll", "params": [20, 2.0]}164 ]165}'166```167168### 单指标接口169170```bash171# A股 RSI172curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/rsi?market=cn&symbol=000001.SZ&interval=1d&period=14&limit=100"173174# 港股 MACD175curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/macd?market=hk&symbol=00700.HK&interval=1d&fast_period=12&slow_period=26&signal_period=9&limit=100"176177# 美股 BOLL178curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/boll?market=us&symbol=AAPL&interval=1d&period=20&nbdev=2.0&limit=100"179180# 无参数指标:OBV181curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/obv?market=cn&symbol=000001.SZ&interval=1d&limit=100"182183# 指标信息184curl -sS "${AUTH[@]}" "$BASE/api/v2/indicators/info"185```186187---188189## 错误排查190191| 错误 | 原因 | 修复 |192|------|------|------|193| 400 (缺 market) | `market` 必填 | 加上 `market`: `cn`/`hk`/`us` |194| 400 (日期格式) | 用了 `YYYYMMDD` | 指标端点用 `YYYY-MM-DD` |195| BOLL 结果错误 | V1 习惯 `nbdev_up`/`nbdev_dn` | V2 用单个 `nbdev`(默认 2.0) |196| 404 | 指标类型拼写错误 | 小写:`rsi`, `macd`, `boll` |