crypto-indicators

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Crypto 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")

代码格式规则

代码格式规则

规则
exchange
必填
binance
,
okx
,
bybit
,
bitget
,
kucoin
,
hyperliquid
symbol
交易对,如
BTCUSDT
,
ETHUSDT
日期格式
YYYY-MM-DD
K线周期
1m
,
5m
,
15m
,
1h
,
4h
,
1d
,
1w

规则
exchange
必填
binance
,
okx
,
bybit
,
bitget
,
kucoin
,
hyperliquid
symbol
交易对,如
BTCUSDT
,
ETHUSDT
日期格式
YYYY-MM-DD
K线周期
1m
,
5m
,
15m
,
1h
,
4h
,
1d
,
1w

支持的指标(27种)

支持的指标(27种)

#IndicatorTypeKey ParametersDefault
1SMATrend
period
20
2EMATrend
period
20
3RSIOscillator
period
14
4MACDTrend
fast_period
,
slow_period
,
signal_period
12, 26, 9
5BOLLVolatility
period
,
nbdev
20, 2.0
6KDJOscillator
fastk_period
,
slowk_period
,
slowd_period
9, 3, 3
7ADXTrend
period
14
8ATRVolatility
period
14
9CCIOscillator
period
14
10VWAPVolume
period
20
11OBVVolume
12NATRVolatility
period
14
13MFIVolume
period
14
14WILLROscillator
period
14
15STDDEVVolatility
period
20
16AroonTrend
period
14
17TRIXTrend
period
9
18MOMMomentum
period
10
19ROCMomentum
period
12
20CMOMomentum
period
14
21ADVolume
22HT TrendlineTrend
23PPOTrend
fast_period
,
slow_period
12, 26
24SARTrend
acceleration
,
maximum
0.02, 0.2
25StochOscillator
k_period
,
d_period
,
smooth_period
14, 3, 3
26ULTOSCOscillator
period1
,
period2
,
period3
7, 14, 28
27ADOSCVolume
fast_period
,
slow_period
3, 10

#IndicatorTypeKey ParametersDefault
1SMA趋势型
period
20
2EMA趋势型
period
20
3RSI震荡型
period
14
4MACD趋势型
fast_period
,
slow_period
,
signal_period
12, 26, 9
5BOLL波动率型
period
,
nbdev
20, 2.0
6KDJ震荡型
fastk_period
,
slowk_period
,
slowd_period
9, 3, 3
7ADX趋势型
period
14
8ATR波动率型
period
14
9CCI震荡型
period
14
10VWAP成交量型
period
20
11OBV成交量型
12NATR波动率型
period
14
13MFI成交量型
period
14
14WILLR震荡型
period
14
15STDDEV波动率型
period
20
16Aroon趋势型
period
14
17TRIX趋势型
period
9
18MOM动量型
period
10
19ROC动量型
period
12
20CMO动量型
period
14
21AD成交量型
22HT Trendline趋势型
23PPO趋势型
fast_period
,
slow_period
12, 26
24SAR趋势型
acceleration
,
maximum
0.02, 0.2
25Stoch震荡型
k_period
,
d_period
,
smooth_period
14, 3, 3
26ULTOSC震荡型
period1
,
period2
,
period3
7, 14, 28
27ADOSC成交量型
fast_period
,
slow_period
3, 10

端点详情

端点详情

POST /api/v2/crypto/indicators/batch — 批量指标(推荐)

POST /api/v2/crypto/indicators/batch — 批量指标(推荐)

一次请求计算多个指标,禁止逐个调用单指标端点
ParameterTypeRequiredDefaultDescription
exchange
stringYes交易所
symbol
stringYes交易对
interval
stringNo
1d
1m
,
5m
,
15m
,
1h
,
4h
,
1d
,
1w
limit
intNo
100
记录数上限
start
stringNo起始日期 YYYY-MM-DD
end
stringNo结束日期 YYYY-MM-DD
indicators
arrayYes指标列表
一次请求计算多个指标,禁止逐个调用单指标端点
ParameterType是否必填Default描述
exchange
string交易所
symbol
string交易对
interval
string
1d
1m
,
5m
,
15m
,
1h
,
4h
,
1d
,
1w
limit
int
100
记录数上限
start
string起始日期 YYYY-MM-DD
end
string结束日期 YYYY-MM-DD
indicators
array指标列表

GET /api/v2/crypto/indicators/{type} — 单指标

GET /api/v2/crypto/indicators/{type} — 单指标

ParameterTypeRequiredDescription
exchange
stringYes交易所
symbol
stringYes交易对
interval
stringNo默认
1d
period
intNo周期参数
limit
intNo默认 100

ParameterType是否必填描述
exchange
string交易所
symbol
string交易对
interval
string默认
1d
period
int周期参数
limit
int默认 100

Batch Params 映射

Batch参数映射

Indicatorparams示例
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省略

Indicatorparams示例
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省略

调用示例

调用示例

批量接口(推荐)

批量接口(推荐)

bash
undefined
bash
undefined

BTC: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]} ] }'
undefined
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]} ] }'
undefined

单指标接口

单指标接口

bash
undefined
bash
undefined

BTC 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)
exchange
必填
加上
exchange
:
binance
400 (日期格式)用了
YYYYMMDD
指标端点用
YYYY-MM-DD
404指标类型拼写错误小写:
rsi
,
macd
,
boll
数据不足K线数量不够计算指标增大
limit
错误原因修复
400(缺少exchange)
exchange
为必填项
添加
exchange
:
binance
400(日期格式错误)使用了
YYYYMMDD
格式
指标端点请使用
YYYY-MM-DD
格式
404指标类型拼写错误使用小写格式:
rsi
,
macd
,
boll
数据不足K线数量不足以计算指标增大
limit