← Back to Indicators

Bollinger Bands API

Bitcoin 4h Bollinger Bands (20, 2) — where price sits inside the envelope, and how wide the envelope is.

API URL
https://hunchmachine.com/api/indicators?indicator=bollinger_bands&api_key=YOUR_API_KEY

Description

Computes Bollinger Bands on Binance BTCUSDT 4-hour closes (20-period SMA, 2 standard deviations). Position inside the bands and relative width give automations a short-term stretch and squeeze read without reconstructing the oscillator from raw klines.

What this endpoint provides

Band levels, relative width, a 0–1 position of the latest close inside the envelope, and a zone label (mid, halves, extremes). Refreshed every 30 minutes so intra-bar location can move while the 4h candle is still forming.

Response fields

timeframe

Candle interval used for the bands (4h).

latest_close

Latest BTCUSDT 4h close (includes the forming candle).

upper, middle, lower

Upper band, 20-period SMA, and lower band.

width_rel

Band width relative to the middle band: (upper − lower) / middle.

position_0_1

Where price sits between lower (0) and upper (1), clamped to that range.

zone

Qualitative location: upper_extreme, upper_half, mid, lower_half, lower_extreme.

summary

Short natural-language read of price vs the middle band and zone.

timestamp

UTC time of the latest update.

Output example

[
  {
    "indicator": "bollinger_bands",
    "timestamp": "2026-09-21T13:00:00.000Z",
    "timeframe": "4h",
    "latest_close": 112450,
    "upper": 114200,
    "middle": 111000,
    "lower": 107800,
    "width_rel": 0.0577,
    "position_0_1": 0.7266,
    "zone": "upper_half",
    "summary": "BTC 4h Bollinger: price 112450 vs mid 111000 (pos 0.73, upper_half)."
  }
]

Interpretation & Use

Upper_extreme / lower_extreme mark stretched 4h closes near or beyond the bands. Upper_half / lower_half are directional but not exhausted. Mid is mean-reversion territory. Rising width_rel is an expanding (trending) envelope; a squeeze shows up as a falling width_rel.