crypto-indicators
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCrypto Indicators — 加密货币技术指标
Crypto Indicators — 加密货币技术指标
所有接口均为 V2 版本()。/api/v2/crypto/indicators/...
所有接口均为V2版本()。/api/v2/crypto/indicators/...
Curl Setup
Curl配置
bash
BASE="http://43.167.234.49:3101"
AUTH=(-H "X-API-Key: 123456" -H "Content-Type: application/json")bash
BASE="http://43.167.234.49:3101"
AUTH=(-H "X-API-Key: 123456" -H "Content-Type: application/json")代码格式规则
代码格式规则
| 规则 | 值 |
|---|---|
| 必填: |
| 交易对,如 |
| 日期格式 | |
| K线周期 | |
| 规则 | 值 |
|---|---|
| 必填: |
| 交易对,如 |
| 日期格式 | |
| K线周期 | |
支持的指标(27种)
支持的指标(27种)
| # | Indicator | Type | Key Parameters | Default |
|---|---|---|---|---|
| 1 | SMA | Trend | | 20 |
| 2 | EMA | Trend | | 20 |
| 3 | RSI | Oscillator | | 14 |
| 4 | MACD | Trend | | 12, 26, 9 |
| 5 | BOLL | Volatility | | 20, 2.0 |
| 6 | KDJ | Oscillator | | 9, 3, 3 |
| 7 | ADX | Trend | | 14 |
| 8 | ATR | Volatility | | 14 |
| 9 | CCI | Oscillator | | 14 |
| 10 | VWAP | Volume | | 20 |
| 11 | OBV | Volume | 无 | — |
| 12 | NATR | Volatility | | 14 |
| 13 | MFI | Volume | | 14 |
| 14 | WILLR | Oscillator | | 14 |
| 15 | STDDEV | Volatility | | 20 |
| 16 | Aroon | Trend | | 14 |
| 17 | TRIX | Trend | | 9 |
| 18 | MOM | Momentum | | 10 |
| 19 | ROC | Momentum | | 12 |
| 20 | CMO | Momentum | | 14 |
| 21 | AD | Volume | 无 | — |
| 22 | HT Trendline | Trend | 无 | — |
| 23 | PPO | Trend | | 12, 26 |
| 24 | SAR | Trend | | 0.02, 0.2 |
| 25 | Stoch | Oscillator | | 14, 3, 3 |
| 26 | ULTOSC | Oscillator | | 7, 14, 28 |
| 27 | ADOSC | Volume | | 3, 10 |
| # | Indicator | Type | Key Parameters | Default |
|---|---|---|---|---|
| 1 | SMA | 趋势型 | | 20 |
| 2 | EMA | 趋势型 | | 20 |
| 3 | RSI | 震荡型 | | 14 |
| 4 | MACD | 趋势型 | | 12, 26, 9 |
| 5 | BOLL | 波动率型 | | 20, 2.0 |
| 6 | KDJ | 震荡型 | | 9, 3, 3 |
| 7 | ADX | 趋势型 | | 14 |
| 8 | ATR | 波动率型 | | 14 |
| 9 | CCI | 震荡型 | | 14 |
| 10 | VWAP | 成交量型 | | 20 |
| 11 | OBV | 成交量型 | 无 | — |
| 12 | NATR | 波动率型 | | 14 |
| 13 | MFI | 成交量型 | | 14 |
| 14 | WILLR | 震荡型 | | 14 |
| 15 | STDDEV | 波动率型 | | 20 |
| 16 | Aroon | 趋势型 | | 14 |
| 17 | TRIX | 趋势型 | | 9 |
| 18 | MOM | 动量型 | | 10 |
| 19 | ROC | 动量型 | | 12 |
| 20 | CMO | 动量型 | | 14 |
| 21 | AD | 成交量型 | 无 | — |
| 22 | HT Trendline | 趋势型 | 无 | — |
| 23 | PPO | 趋势型 | | 12, 26 |
| 24 | SAR | 趋势型 | | 0.02, 0.2 |
| 25 | Stoch | 震荡型 | | 14, 3, 3 |
| 26 | ULTOSC | 震荡型 | | 7, 14, 28 |
| 27 | ADOSC | 成交量型 | | 3, 10 |
端点详情
端点详情
POST /api/v2/crypto/indicators/batch — 批量指标(推荐)
POST /api/v2/crypto/indicators/batch — 批量指标(推荐)
一次请求计算多个指标,禁止逐个调用单指标端点。
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | — | 交易所 |
| string | Yes | — | 交易对 |
| string | No | | |
| int | No | | 记录数上限 |
| string | No | — | 起始日期 YYYY-MM-DD |
| string | No | — | 结束日期 YYYY-MM-DD |
| array | Yes | — | 指标列表 |
一次请求计算多个指标,禁止逐个调用单指标端点。
| Parameter | Type | 是否必填 | Default | 描述 |
|---|---|---|---|---|
| string | 是 | — | 交易所 |
| string | 是 | — | 交易对 |
| string | 否 | | |
| int | 否 | | 记录数上限 |
| string | 否 | — | 起始日期 YYYY-MM-DD |
| string | 否 | — | 结束日期 YYYY-MM-DD |
| array | 是 | — | 指标列表 |
GET /api/v2/crypto/indicators/{type} — 单指标
GET /api/v2/crypto/indicators/{type} — 单指标
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | 交易所 |
| string | Yes | 交易对 |
| string | No | 默认 |
| int | No | 周期参数 |
| int | No | 默认 100 |
| Parameter | Type | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 交易所 |
| string | 是 | 交易对 |
| string | 否 | 默认 |
| int | 否 | 周期参数 |
| int | 否 | 默认 100 |
Batch Params 映射
Batch参数映射
| Indicator | params | 示例 |
|---|---|---|
| sma, ema, rsi, atr, cci, vwap, natr, mfi, willr, stddev, aroon, trix | | |
| mom, roc, cmo | | |
| macd | | |
| boll | | |
| kdj | | |
| ppo, adosc | | |
| sar | | |
| stoch | | |
| ultosc | | |
| obv, ad, ht_trendline | 无 params | 省略 |
| Indicator | params | 示例 |
|---|---|---|
| sma, ema, rsi, atr, cci, vwap, natr, mfi, willr, stddev, aroon, trix | | |
| mom, roc, cmo | | |
| macd | | |
| boll | | |
| kdj | | |
| ppo, adosc | | |
| sar | | |
| stoch | | |
| ultosc | | |
| obv, ad, ht_trendline | 无 params | 省略 |
调用示例
调用示例
批量接口(推荐)
批量接口(推荐)
bash
undefinedbash
undefinedBTC:RSI + MACD + BOLL + KDJ
BTC:RSI + MACD + BOLL + KDJ
curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/crypto/indicators/batch" -d '{
"exchange": "binance",
"symbol": "BTCUSDT",
"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]}
]
}'
curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/crypto/indicators/batch" -d '{
"exchange": "binance",
"symbol": "BTCUSDT",
"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]}
]
}'
ETH:4h 级别 MACD + EMA
ETH:4h 级别 MACD + EMA
curl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/crypto/indicators/batch" -d '{
"exchange": "binance",
"symbol": "ETHUSDT",
"interval": "4h",
"limit": 200,
"indicators": [
{"type": "macd", "params": [12, 26, 9]},
{"type": "ema", "params": [20]}
]
}'
undefinedcurl -sS "${AUTH[@]}" -X POST "$BASE/api/v2/crypto/indicators/batch" -d '{
"exchange": "binance",
"symbol": "ETHUSDT",
"interval": "4h",
"limit": 200,
"indicators": [
{"type": "macd", "params": [12, 26, 9]},
{"type": "ema", "params": [20]}
]
}'
undefined单指标接口
单指标接口
bash
undefinedbash
undefinedBTC RSI
BTC RSI
curl -sS "${AUTH[@]}" "$BASE/api/v2/crypto/indicators/rsi?exchange=binance&symbol=BTCUSDT&interval=1d&period=14&limit=100"
curl -sS "${AUTH[@]}" "$BASE/api/v2/crypto/indicators/rsi?exchange=binance&symbol=BTCUSDT&interval=1d&period=14&limit=100"
ETH MACD
ETH MACD
curl -sS "${AUTH[@]}" "$BASE/api/v2/crypto/indicators/macd?exchange=binance&symbol=ETHUSDT&interval=1d&fast_period=12&slow_period=26&signal_period=9&limit=100"
curl -sS "${AUTH[@]}" "$BASE/api/v2/crypto/indicators/macd?exchange=binance&symbol=ETHUSDT&interval=1d&fast_period=12&slow_period=26&signal_period=9&limit=100"
SOL BOLL
SOL BOLL
curl -sS "${AUTH[@]}" "$BASE/api/v2/crypto/indicators/boll?exchange=binance&symbol=SOLUSDT&interval=1d&period=20&nbdev=2.0&limit=100"
curl -sS "${AUTH[@]}" "$BASE/api/v2/crypto/indicators/boll?exchange=binance&symbol=SOLUSDT&interval=1d&period=20&nbdev=2.0&limit=100"
无参数指标:OBV
无参数指标:OBV
curl -sS "${AUTH[@]}" "$BASE/api/v2/crypto/indicators/obv?exchange=binance&symbol=BTCUSDT&interval=1d&limit=100"
---curl -sS "${AUTH[@]}" "$BASE/api/v2/crypto/indicators/obv?exchange=binance&symbol=BTCUSDT&interval=1d&limit=100"
---错误排查
错误排查
| 错误 | 原因 | 修复 |
|---|---|---|
| 400 (缺 exchange) | | 加上 |
| 400 (日期格式) | 用了 | 指标端点用 |
| 404 | 指标类型拼写错误 | 小写: |
| 数据不足 | K线数量不够计算指标 | 增大 |
| 错误 | 原因 | 修复 |
|---|---|---|
| 400(缺少exchange) | | 添加 |
| 400(日期格式错误) | 使用了 | 指标端点请使用 |
| 404 | 指标类型拼写错误 | 使用小写格式: |
| 数据不足 | K线数量不足以计算指标 | 增大 |