Technical Analysis — Indicator Engine v3
Local computation engine, no API key required. Pulls data from HTX kline endpoints and computes indicators / patterns / cycles locally with numpy/pandas.
Compliance disclaimer: this skill provides raw indicator values and does not embed any strategy recommendations or trading advice. All decisions are made by the user based on their own risk tolerance.
Capability overview
| Category |
Count |
File |
| Moving averages |
8 (ma, ema, wma, dema, tema, hma, kama, zlema) |
scripts/indicators.py |
| Trend |
8 (macd, adx, aroon, cci, supertrend, sar, dpo, envelope) |
same |
| Momentum |
10 (rsi, stoch-rsi, stoch, kdj, roc, mom, ppo, trix, wr, uo) |
same |
| Volatility |
8 (bb, bbwidth, bbpct, atr, keltner, donchian, hv, stddev) |
same |
| Volume |
6 (obv, vwap, mvwap, cmf, mfi, ad) |
same |
| Statistics |
5 (lr, slope, angle, variance, sigma) |
same |
| Other |
5 (fisher, tr, tp, mp, cho) + divergence |
same |
| Candlestick patterns |
12 (doji / engulfing / harami / 3-soldiers / 3-crows ...) |
scripts/patterns.py |
| BTC cycle |
5 (ahr999 / ahr999x / rainbow / pi-cycle / mayer) |
scripts/cycle.py |
| Indicator total |
51 indicators + 12 patterns + 5 cycles = 68 |
|
Quick start
Pull klines + compute indicators
# 1. Pull BTC/USDT 4-hour klines
htx-cli spot-market kline -p symbol=btcusdt -p period=4hour -p size=300 \
| jq '.data' > /tmp/btc4h.json
# 2. Compute RSI
python scripts/indicators.py rsi --kline /tmp/btc4h.json --params 14
# → {"rsi": 62.4, "ts": 1779000000000}
# 3. Compute MACD (default 12,26,9)
python scripts/indicators.py macd --kline /tmp/btc4h.json
# → {"dif": 320.1, "dea": 245.3, "macd": 149.6, "ts": ...}
# 4. Scan all candlestick patterns
python scripts/patterns.py scan --kline /tmp/btc4h.json
# → {"patterns": ["doji", "bull-engulf"], "ts": ...}
# 5. BTC cycle one-shot full run
python scripts/cycle.py all --kline /tmp/btc1d.json
List all indicators
python scripts/indicators.py list
# → ["ma", "ema", "rsi", "macd", "supertrend", ...]
Command reference
See references/:
references/indicators.md — parameters / return fields / formulas for the 51 technical indicators
references/patterns.md — judgment rules and typical scenarios for the 12 candlestick patterns
references/cycle.md — formulas and interpretation ranges for the 5 BTC cycle indicators
references/divergence.md — automatic divergence detection algorithm and usage notes
Automatic divergence detection
python scripts/indicators.py divergence --kline /tmp/btc4h.json --params 14
# → {"divergence": "bull_reg", ...}
Return values:
bull_reg — price makes a new low, indicator does not (bottom reversal signal)
bear_reg — price makes a new high, indicator does not (top reversal signal)
bull_hid — price makes a higher low, indicator a lower low (pullback within uptrend)
bear_hid — price makes a lower high, indicator a higher high (bounce within downtrend)
BTC cycle indicators (BTC-USDT only)
All 5 indicators are based on price + time formulas; no on-chain data required:
| Indicator |
Use |
Interpretation |
ahr999 |
DCA timing |
<0.45 bottom-fish / 0.45-1.2 DCA / >1.2 top warning |
ahr999x |
Pure cycle signal |
Ratio vs fitted curve |
rainbow |
9-band rainbow valuation |
"Fire Sale" → "Maximum Bubble" |
pi-cycle |
Cycle-top warning |
111d MA crosses above 350d MA × 2 = historical top |
mayer |
Long-term valuation |
<1 undervalued / >2.4 historical bubble |
Data requirements
| Indicator type |
Min klines |
| Short-period (RSI 14, MACD 26, ATR 14) |
50 bars |
| Long-period (MA200, KAMA) |
200+ bars |
| BTC cycle (Pi Cycle 350d, Mayer 200d) |
350+ daily klines |
| Divergence detection |
50+ bars |
Typical scenarios
"How does BTC 4H look technically?"
htx-cli spot-market kline -p symbol=btcusdt -p period=4hour -p size=200 | jq '.data' > btc.json
python scripts/indicators.py rsi --kline btc.json
python scripts/indicators.py macd --kline btc.json
python scripts/indicators.py supertrend --kline btc.json
python scripts/patterns.py scan --kline btc.json
python scripts/indicators.py divergence --kline btc.json
# AI synthesizes all outputs to make a judgment
"Is ETH overbought?"
python scripts/indicators.py rsi --kline eth4h.json
# rsi > 70 means overbought
"BTC long-term valuation right now"
htx-cli spot-market kline -p symbol=btcusdt -p period=1day -p size=400 | jq '.data' > btc1d.json
python scripts/cycle.py all --kline btc1d.json
Relationship with other skills
- Data source: depends on
htx/spot-market or htx/futures-market for klines
- Upper-layer orchestration: invoked by
htx/ta-master as the "price/volume" pillar
Installation
curl -fsSL https://github.com/htx-exchange/htx-skills-hub/releases/latest/download/install.sh | bash -s -- technical-analysis
1---2name: htx-technical-analysis3description: HTX technical indicator analysis engine — 51 indicators + 12 candlestick patterns + 5 BTC cycle indicators + automatic divergence detection, all computed locally in Python.4---56# Technical Analysis — Indicator Engine v378Local computation engine, **no API key required**. Pulls data from HTX kline endpoints and computes indicators / patterns / cycles locally with numpy/pandas.910> **Compliance disclaimer**: this skill provides raw indicator values and does not embed any strategy recommendations or trading advice. All decisions are made by the user based on their own risk tolerance.1112## Capability overview1314| Category | Count | File |15|---|---|---|16| Moving averages | 8 (ma, ema, wma, dema, tema, hma, kama, zlema) | `scripts/indicators.py` |17| Trend | 8 (macd, adx, aroon, cci, supertrend, sar, dpo, envelope) | same |18| Momentum | 10 (rsi, stoch-rsi, stoch, kdj, roc, mom, ppo, trix, wr, uo) | same |19| Volatility | 8 (bb, bbwidth, bbpct, atr, keltner, donchian, hv, stddev) | same |20| Volume | 6 (obv, vwap, mvwap, cmf, mfi, ad) | same |21| Statistics | 5 (lr, slope, angle, variance, sigma) | same |22| Other | 5 (fisher, tr, tp, mp, cho) + divergence | same |23| **Candlestick patterns** | 12 (doji / engulfing / harami / 3-soldiers / 3-crows ...) | `scripts/patterns.py` |24| **BTC cycle** | 5 (ahr999 / ahr999x / rainbow / pi-cycle / mayer) | `scripts/cycle.py` |25| **Indicator total** | **51 indicators + 12 patterns + 5 cycles = 68** | |2627## Quick start2829### Pull klines + compute indicators3031```bash32# 1. Pull BTC/USDT 4-hour klines33htx-cli spot-market kline -p symbol=btcusdt -p period=4hour -p size=300 \34 | jq '.data' > /tmp/btc4h.json3536# 2. Compute RSI37python scripts/indicators.py rsi --kline /tmp/btc4h.json --params 1438# → {"rsi": 62.4, "ts": 1779000000000}3940# 3. Compute MACD (default 12,26,9)41python scripts/indicators.py macd --kline /tmp/btc4h.json42# → {"dif": 320.1, "dea": 245.3, "macd": 149.6, "ts": ...}4344# 4. Scan all candlestick patterns45python scripts/patterns.py scan --kline /tmp/btc4h.json46# → {"patterns": ["doji", "bull-engulf"], "ts": ...}4748# 5. BTC cycle one-shot full run49python scripts/cycle.py all --kline /tmp/btc1d.json50```5152### List all indicators5354```bash55python scripts/indicators.py list56# → ["ma", "ema", "rsi", "macd", "supertrend", ...]57```5859## Command reference6061See `references/`:62- `references/indicators.md` — parameters / return fields / formulas for the 51 technical indicators63- `references/patterns.md` — judgment rules and typical scenarios for the 12 candlestick patterns64- `references/cycle.md` — formulas and interpretation ranges for the 5 BTC cycle indicators65- `references/divergence.md` — automatic divergence detection algorithm and usage notes6667## Automatic divergence detection6869```bash70python scripts/indicators.py divergence --kline /tmp/btc4h.json --params 1471# → {"divergence": "bull_reg", ...}72```7374Return values:75- `bull_reg` — price makes a new low, indicator does not (**bottom reversal signal**)76- `bear_reg` — price makes a new high, indicator does not (**top reversal signal**)77- `bull_hid` — price makes a higher low, indicator a lower low (**pullback within uptrend**)78- `bear_hid` — price makes a lower high, indicator a higher high (**bounce within downtrend**)7980## BTC cycle indicators (BTC-USDT only)8182All 5 indicators are based on price + time formulas; no on-chain data required:8384| Indicator | Use | Interpretation |85|---|---|---|86| `ahr999` | DCA timing | <0.45 bottom-fish / 0.45-1.2 DCA / >1.2 top warning |87| `ahr999x` | Pure cycle signal | Ratio vs fitted curve |88| `rainbow` | 9-band rainbow valuation | "Fire Sale" → "Maximum Bubble" |89| `pi-cycle` | Cycle-top warning | 111d MA crosses above 350d MA × 2 = historical top |90| `mayer` | Long-term valuation | <1 undervalued / >2.4 historical bubble |9192## Data requirements9394| Indicator type | Min klines |95|---|---|96| Short-period (RSI 14, MACD 26, ATR 14) | 50 bars |97| Long-period (MA200, KAMA) | 200+ bars |98| BTC cycle (Pi Cycle 350d, Mayer 200d) | 350+ daily klines |99| Divergence detection | 50+ bars |100101## Typical scenarios102103**"How does BTC 4H look technically?"**104```bash105htx-cli spot-market kline -p symbol=btcusdt -p period=4hour -p size=200 | jq '.data' > btc.json106python scripts/indicators.py rsi --kline btc.json107python scripts/indicators.py macd --kline btc.json108python scripts/indicators.py supertrend --kline btc.json109python scripts/patterns.py scan --kline btc.json110python scripts/indicators.py divergence --kline btc.json111# AI synthesizes all outputs to make a judgment112```113114**"Is ETH overbought?"**115```bash116python scripts/indicators.py rsi --kline eth4h.json117# rsi > 70 means overbought118```119120**"BTC long-term valuation right now"**121```bash122htx-cli spot-market kline -p symbol=btcusdt -p period=1day -p size=400 | jq '.data' > btc1d.json123python scripts/cycle.py all --kline btc1d.json124```125126## Relationship with other skills127128- **Data source**: depends on `htx/spot-market` or `htx/futures-market` for klines129- **Upper-layer orchestration**: invoked by `htx/ta-master` as the "price/volume" pillar130131## Installation132133```bash134curl -fsSL https://github.com/htx-exchange/htx-skills-hub/releases/latest/download/install.sh | bash -s -- technical-analysis135```