taapi

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TaAPI — Technical Analysis Indicators

TaAPI — 技术分析指标

⛔ HARD LIMIT

⛔ 严格限制

最多调用 indicator/support_resistance 共 5 次。
⛔ 绝对禁止:bash、write_file、learning_log、coin_price、cg_ohlc_history 等非 TaAPI 工具。
⛔ 布林带已含中轨(中轨≈当前价),不需要再调 coin_price 获取价格。
⛔ RSI 问题只需 indicator(name="rsi") 一次,不需要 learning_log 或其他工具。
最多调用 indicator/support_resistance 共 5 次。
⛔ 绝对禁止:bash、write_file、learning_log、coin_price、cg_ohlc_history 等非 TaAPI 工具。
⛔ 布林带已含中轨(中轨≈当前价),不需要再调 coin_price 获取价格。
⛔ RSI 问题只需 indicator(name="rsi") 一次,不需要 learning_log 或其他工具。

When to Use

使用场景

任何加密货币技术指标问题 → 用 TaAPI
  • "BTC RSI 多少?" →
    indicator(name="rsi", symbol="BTC/USDT")
  • "ETH MACD 什么信号?" →
    indicator(name="macd", symbol="ETH/USDT")
  • "SOL 布林带收缩还是扩张?" →
    indicator(name="bbands", symbol="SOL/USDT")
  • "BTC 支撑位阻力位?" →
    support_resistance(symbol="BTC/USDT")
NOT for: 股票/外汇技术指标(TwelveData 有自己的技术功能)
任何加密货币技术指标问题 → 用 TaAPI
  • "BTC RSI 多少?" →
    indicator(name="rsi", symbol="BTC/USDT")
  • "ETH MACD 什么信号?" →
    indicator(name="macd", symbol="ETH/USDT")
  • "SOL 布林带收缩还是扩张?" →
    indicator(name="bbands", symbol="SOL/USDT")
  • "BTC 支撑位阻力位?" →
    support_resistance(symbol="BTC/USDT")
不适用场景: 股票/外汇技术指标(TwelveData 有专属技术功能)

Keyword → Tool

关键词 → 工具映射

用户说工具参数
RSI/超买/超卖
indicator
name="rsi"
MACD/金叉/死叉
indicator
name="macd"
布林带/Bollinger/带宽/收缩
indicator
name="bbands"
支撑位/阻力位/关键价位
support_resistance
EMA/均线/移动平均
indicator
name="ema"
ADX/趋势强度
indicator
name="adx"
ATR/波动率
indicator
name="atr"
KDJ/Stochastic/随机指标
indicator
name="stoch"
OBV/成交量指标
indicator
name="obv"
综合技术分析多次
indicator
依次调 rsi, macd, bbands
用户提问内容工具参数
RSI/超买/超卖
indicator
name="rsi"
MACD/金叉/死叉
indicator
name="macd"
布林带/Bollinger/带宽/收缩
indicator
name="bbands"
支撑位/阻力位/关键价位
support_resistance
EMA/均线/移动平均
indicator
name="ema"
ADX/趋势强度
indicator
name="adx"
ATR/波动率
indicator
name="atr"
KDJ/Stochastic/随机指标
indicator
name="stoch"
OBV/成交量指标
indicator
name="obv"
综合技术分析多次
indicator
依次调用 rsi, macd, bbands

Common Mistakes

常见错误

❌ MISTAKE 1: 用 cg_ohlc_history + bash 手动计算指标

❌ 错误1:使用 cg_ohlc_history + bash 手动计算指标

WRONG: cg_ohlc_history(symbol="BTC") → bash("python3 calc_rsi.py")
RIGHT: indicator(name="rsi", symbol="BTC/USDT", interval="1h")
为什么:TaAPI 返回预计算的精确指标值,不需要拉K线再自己算。又快又准。
错误示例:cg_ohlc_history(symbol="BTC") → bash("python3 calc_rsi.py")
正确示例:indicator(name="rsi", symbol="BTC/USDT", interval="1h")
原因:TaAPI 返回预计算的精确指标值,无需拉取K线后自行计算,既快速又准确。

❌ MISTAKE 6: RSI 问题调了 learning_log / request_env_input

❌ 错误6:RSI 问题调用 learning_log / request_env_input

WRONG: learning_log(...) → indicator(name="rsi", ...) → indicator(name="rsi", ...)
RIGHT: indicator(name="rsi", symbol="BTC/USDT", interval="1h")  # 一次即可
已知规则:TaAPI SKILL 已加载,直接调工具,不需要查日志或请求环境变量。
错误示例:learning_log(...) → indicator(name="rsi", ...) → indicator(name="rsi", ...)
正确示例:indicator(name="rsi", symbol="BTC/USDT", interval="1h")  # 仅需调用一次
已知规则:TaAPI SKILL 已加载,直接调用工具即可,无需查询日志或请求环境变量。

❌ MISTAKE 7: 布林带问题额外调 coin_price

❌ 错误7:布林带问题额外调用 coin_price

WRONG: indicator(name="bbands", symbol="BTC/USDT") → coin_price(coin_ids="bitcoin")  # 多余!
RIGHT: indicator(name="bbands", symbol="BTC/USDT", interval="1h")
布林带响应包含 upperBand/middleBand/lowerBand,middleBand ≈ 当前价格,无需再查价格。 判断"离哪个轨近":直接比较 upperBand 和 lowerBand 与 middleBand 的距离即可。
错误示例:indicator(name="bbands", symbol="BTC/USDT") → coin_price(coin_ids="bitcoin")  # 多余操作!
正确示例:indicator(name="bbands", symbol="BTC/USDT", interval="1h")
布林带响应包含 upperBand/middleBand/lowerBand,其中 middleBand ≈ 当前价格,无需额外查询价格。 判断「价格离哪个轨更近」:直接比较 upperBand 和 lowerBand 与 middleBand 的距离即可。

❌ MISTAKE 8: 技术面分析混入价格工具

❌ 错误8:技术面分析混入价格工具

WRONG: indicator(name="rsi") + indicator(name="macd") + coin_price(...)  # coin_price 无关
RIGHT: indicator(name="rsi") + indicator(name="macd")  # 技术分析只用 TaAPI 工具
MACD histogram 已反映价格趋势,分析不需要额外价格数据。
错误示例:indicator(name="rsi") + indicator(name="macd") + coin_price(...)  # coin_price 无关
正确示例:indicator(name="rsi") + indicator(name="macd")  # 技术分析仅使用 TaAPI 工具
MACD 柱状图已反映价格趋势,分析无需额外价格数据。

❌ MISTAKE 9: 支撑阻力用 indicator 或 coin_ohlc 手算

❌ 错误9:支撑阻力位使用 indicator 或 coin_ohlc 手动计算

WRONG: indicator(name="rsi") + coin_ohlc(coin_id="bitcoin")  # 用K线手动找支撑
RIGHT: support_resistance(symbol="BTC/USDT", interval="1d")
支撑位/阻力位 = 必须用
support_resistance
工具,直接返回关键价格区间,禁止用 coin_ohlc + 推理。
错误示例:indicator(name="rsi") + coin_ohlc(coin_id="bitcoin")  # 用K线手动寻找支撑位
正确示例:support_resistance(symbol="BTC/USDT", interval="1d")
规则:支撑位/阻力位必须使用
support_resistance
工具,直接返回关键价格区间,禁止使用 coin_ohlc + 推理计算。

❌ MISTAKE 2: 布林带只查一次就判断收缩/扩张

❌ 错误2:仅调用一次布林带就判断收缩/扩张

WRONG: indicator(name="bbands", symbol="SOL/USDT", interval="1h")  # 单次无法判断趋势
RIGHT:
  indicator(name="bbands", symbol="SOL/USDT", interval="1h")   # 当前带宽
  indicator(name="bbands", symbol="SOL/USDT", interval="4h")   # 更大周期对比
  indicator(name="atr", symbol="SOL/USDT", interval="1h")      # ATR 辅助判断波动率
为什么:收缩/扩张是相对概念,需要多周期或 ATR 辅助判断。
错误示例:indicator(name="bbands", symbol="SOL/USDT", interval="1h")  # 单次数据无法判断趋势
正确示例:
  indicator(name="bbands", symbol="SOL/USDT", interval="1h")   # 当前带宽
  indicator(name="bbands", symbol="SOL/USDT", interval="4h")   # 更大周期对比
  indicator(name="atr", symbol="SOL/USDT", interval="1h")      # 用ATR辅助判断波动率
原因:收缩/扩张是相对概念,需要多周期数据或ATR指标辅助判断。

❌ MISTAKE 3: interval 参数格式错误

❌ 错误3:interval 参数格式错误

WRONG: indicator(name="rsi", symbol="BTC/USDT", interval="1hour")
RIGHT: indicator(name="rsi", symbol="BTC/USDT", interval="1h")
有效值:1m, 5m, 15m, 30m, 1h, 2h, 4h, 12h, 1d, 1w
错误示例:indicator(name="rsi", symbol="BTC/USDT", interval="1hour")
正确示例:indicator(name="rsi", symbol="BTC/USDT", interval="1h")
有效值:1m, 5m, 15m, 30m, 1h, 2h, 4h, 12h, 1d, 1w

❌ MISTAKE 4: 综合分析只调一个指标

❌ 错误4:综合分析仅调用一个指标

WRONG: indicator(name="rsi") → "RSI 看多所以看多"
RIGHT:
  indicator(name="rsi")     → 动量
  indicator(name="macd")    → 趋势
  indicator(name="bbands")  → 波动率
  → 综合三者给结论
错误示例:indicator(name="rsi") → "RSI 看多所以整体看多"
正确示例:
  indicator(name="rsi")     → 动量指标
  indicator(name="macd")    → 趋势指标
  indicator(name="bbands")  → 波动率指标
  → 结合三者给出结论

❌ MISTAKE 5: 混淆 indicator 和 support_resistance

❌ 错误5:混淆 indicator 和 support_resistance

WRONG: indicator(name="support_resistance", symbol="BTC/USDT")
RIGHT: support_resistance(symbol="BTC/USDT", interval="1d")
Rule: 支撑/阻力是独立工具
support_resistance
,不是
indicator
的参数。
错误示例:indicator(name="support_resistance", symbol="BTC/USDT")
正确示例:support_resistance(symbol="BTC/USDT", interval="1d")
规则:支撑/阻力位是独立工具
support_resistance
,不是
indicator
的参数。

Available Indicators

可用指标

Momentum

动量指标

NameDescriptionKey Levels
rsiRelative Strength Index>70 超买, <30 超卖
stochStochastic Oscillator>80 超买, <20 超卖
cciCommodity Channel Index>100 超买, <-100 超卖
mfiMoney Flow Index>80 超买, <20 超卖
名称描述关键阈值
rsiRelative Strength Index>70 超买, <30 超卖
stochStochastic Oscillator>80 超买, <20 超卖
cciCommodity Channel Index>100 超买, <-100 超卖
mfiMoney Flow Index>80 超买, <20 超卖

Trend

趋势指标

NameDescriptionSignal
macdMACDhistogram>0 看多, <0 看空
adxAverage Directional Index>25 强趋势
emaExponential Moving Average价格在上=多头
smaSimple Moving Average价格在上=多头
名称描述信号
macdMACDhistogram>0 看多, <0 看空
adxAverage Directional Index>25 强趋势
emaExponential Moving Average价格在均线上方=多头
smaSimple Moving Average价格在均线上方=多头

Volatility

波动率指标

NameDescriptionSignal
bbandsBollinger Bands带宽收缩=将突破
atrAverage True Range值大=波动大
名称描述信号
bbandsBollinger Bands带宽收缩=即将突破
atrAverage True Range值越大=波动越大

Interpretation Guide

指标解读指南

RSI

RSI

  • >70: 超买(可能回调)
  • 50-70: 多头动量
  • 30-50: 空头动量
  • <30: 超卖(可能反弹)
  • >70: 超买(可能回调)
  • 50-70: 多头动量
  • 30-50: 空头动量
  • <30: 超卖(可能反弹)

MACD

MACD

  • Histogram > 0 且增大: 多头加速
  • Histogram > 0 但减小: 多头减弱
  • Histogram < 0 且减小: 空头加速
  • 零轴穿越: 趋势反转信号
  • Histogram > 0 且数值增大: 多头趋势加速
  • Histogram > 0 但数值减小: 多头趋势减弱
  • Histogram < 0 且数值减小: 空头趋势加速
  • 零轴穿越: 趋势反转信号

Bollinger Bands

布林带

  • 价格触上轨: 超买
  • 价格触下轨: 超卖
  • 带宽收窄: 即将突破(方向待定)
  • 带宽扩张: 趋势进行中
  • 价格触碰上轨: 超买
  • 价格触碰下轨: 超卖
  • 带宽收窄: 即将突破(方向待定)
  • 带宽扩张: 趋势正在进行

Workflow Templates

工作流模板

快速多空判断

快速多空判断

indicator(name="rsi", symbol="BTC/USDT", interval="1h")
indicator(name="macd", symbol="BTC/USDT", interval="1h")
→ RSI + MACD 同向 = 强信号
indicator(name="rsi", symbol="BTC/USDT", interval="1h")
indicator(name="macd", symbol="BTC/USDT", interval="1h")
→ RSI + MACD 信号同向 = 强信号

完整技术体检

完整技术体检

indicator(name="rsi", symbol="BTC/USDT", interval="4h")
indicator(name="macd", symbol="BTC/USDT", interval="4h")
indicator(name="bbands", symbol="BTC/USDT", interval="4h")
indicator(name="adx", symbol="BTC/USDT", interval="4h")
support_resistance(symbol="BTC/USDT", interval="1d")
→ 5 维度综合分析
indicator(name="rsi", symbol="BTC/USDT", interval="4h")
indicator(name="macd", symbol="BTC/USDT", interval="4h")
indicator(name="bbands", symbol="BTC/USDT", interval="4h")
indicator(name="adx", symbol="BTC/USDT", interval="4h")
support_resistance(symbol="BTC/USDT", interval="1d")
→ 5维度综合分析

Few-Shot 示例(约束遵循)

Few-Shot 示例(约束遵循)

示例 1: 只要数字

示例1: 仅需指标数值

Q: BTC 当前 RSI 是多少?
✅ 调用: indicator(name="rsi", symbol="BTC/USDT", interval="1h")
✅ 输出: 58.3
❌ 错误: learning_log() → indicator() → indicator()  # 重复调用+无关工具
问题: BTC 当前 RSI 是多少?
✅ 调用: indicator(name="rsi", symbol="BTC/USDT", interval="1h")
✅ 输出: 58.3
❌ 错误操作: learning_log() → indicator() → indicator()  # 重复调用+无关工具

示例 2: 布林带"离哪个轨近"

示例2: 布林带「离哪个轨近」

Q: BTC 布林带上下轨在哪?当前价格离哪个轨近?
✅ 调用: indicator(name="bbands", symbol="BTC/USDT", interval="1h")
✅ 输出: 上轨 $96,800 | 中轨 $94,200(≈当前价)| 下轨 $91,600 → 离下轨更近
❌ 错误: indicator(name="bbands") + coin_price(coin_ids="bitcoin")  # coin_price 多余
问题: BTC 布林带上下轨在哪?当前价格离哪个轨近?
✅ 调用: indicator(name="bbands", symbol="BTC/USDT", interval="1h")
✅ 输出: 上轨 $96,800 | 中轨 $94,200(≈当前价)| 下轨 $91,600 → 离下轨更近
❌ 错误操作: indicator(name="bbands") + coin_price(coin_ids="bitcoin")  # coin_price 多余

示例 4: 支撑阻力位

示例4: 支撑阻力位

Q: BTC 当前支撑位和阻力位在哪?只要两个数字
✅ 调用: support_resistance(symbol="BTC/USDT", interval="1d")
✅ 输出: 支撑 $82,000 | 阻力 $88,500
❌ 错误: indicator(name="rsi") + coin_ohlc(...)  # 完全错工具
问题: BTC 当前支撑位和阻力位在哪?只要两个数值
✅ 调用: support_resistance(symbol="BTC/USDT", interval="1d")
✅ 输出: 支撑 $82,000 | 阻力 $88,500
❌ 错误操作: indicator(name="rsi") + coin_ohlc(...)  # 工具使用完全错误

示例 3: 技术面综合

示例3: 技术面综合分析

Q: BTC 技术面怎么看?RSI 和 MACD 什么信号?
✅ 调用: indicator(name="rsi", ...) → indicator(name="macd", ...)
✅ 输出: RSI 62(多头区间)| MACD histogram +220(多头加速)→ 短期偏多
❌ 错误: indicator() + coin_price()  # 技术分析不需要价格工具
问题: BTC 技术面怎么看?RSI 和 MACD 什么信号?
✅ 调用: indicator(name="rsi", ...) → indicator(name="macd", ...)
✅ 输出: RSI 62(多头区间)| MACD histogram +220(多头加速)→ 短期偏多
❌ 错误操作: indicator() + coin_price()  # 技术分析不需要价格工具

Symbol Format

交易对格式

COIN/USDT
— 例如:
BTC/USDT
,
ETH/USDT
,
SOL/USDT
COIN/USDT
— 例如:
BTC/USDT
,
ETH/USDT
,
SOL/USDT

Default Exchange

默认交易所

Binance(可选:binancefutures, bybit, okex)
Binance(可选:binancefutures, bybit, okex)