Technical Indicator API Guide技术指标 API 指南

Free Bollinger Bands API
JSON, Inputs & Python
免费布林带指标 API
参数、JSON 与 Python

Compare free Bollinger Bands API options, verify symbols, intervals, fields, limits, and freshness, then test an upper, middle, and lower band request.

比较免费布林带指标 API 的市场、周期、参数、字段和额度,
再用 Python 验证上轨、中轨、下轨与时间戳。

Hand-drawn free Bollinger Bands API workflow from price data through a 20-period moving average and standard deviation to upper, middle, and lower bands in JSON 基于英文母版本地化的免费 Bollinger Bands API 白板:展示价格数据、20 周期 SMA、标准差、上轨中轨下轨和 JSON 响应

What a free Bollinger Bands API should provide免费布林带指标 API 应提供什么

A useful technical-indicator API returns Bollinger Bands for a chosen symbol and interval with a documented calculation contract. It should let the application set or verify the moving-average period and standard-deviation multiplier, retrieve timestamped JSON, and connect the result to a chart, scanner, research workflow, or agent without guessing the underlying price series.

可用的技术指标 API 应按照明确的计算契约,为指定股票或交易对及时间周期返回布林带。应用需要能够设置或核对移动平均周期和标准差倍数,获取带时间戳的 JSON,并在不猜测底层价格口径的前提下,把结果接入图表、扫描器、量化研究流程或 Agent。

Important: “Free” may mean a limited tier, trial, delayed feed, or non-commercial license. Indicator values depend on source prices, adjustment rules, period, deviation multiplier, and warm-up history; they are not investment advice.

重要:“免费”可能是限次套餐、试用、延迟行情或非商业许可。指标值会受到源价格、复权规则、周期、标准差倍数和预热数据长度影响,不构成投资建议。

Bollinger Bands API inputs and response fields布林带 API 的参数与返回字段

Symbol, market, and interval

Confirm whether the endpoint supports stocks, forex, or crypto and accepts daily, weekly, or intraday intervals. Check exchange identifiers, timezone, and adjusted versus unadjusted prices.

Period and standard-deviation multiplier

A common default is a 20-period moving average with bands two standard deviations away. Do not assume defaults: send the period, moving-average type, and deviation values when documented.

Upper, middle, and lower band JSON

Require timestamped upper, middle, and lower values plus symbol, interval, period, and calculation metadata. Validate numeric types, chronological order, missing values, and warm-up rows.

API key, limits, freshness, and license

Check authentication, calls per minute or day, historical depth, real-time entitlement, caching, attribution, redistribution, commercial use, and explicit error payloads.

Bandwidth and percent B definitions

Some endpoints add bandwidth and %B, but formulas and zero-width handling must be documented. Common definitions divide band width by the middle band and locate price within the upper-lower range. Preserve the chosen price input, scaling, and null behavior rather than treating similarly named fields as interchangeable.

Squeeze and breakout labels

A “squeeze” requires an explicit bandwidth threshold, comparison history, and confirmation rule; touching or crossing a band is not automatically a breakout or reversal. Prefer raw bands and bandwidth, then version any alert logic in the application so it can be tested without inheriting an opaque provider label.

Session and source-price alignment

Store exchange or venue, timezone, regular versus extended session, candle status, source timestamp, and adjusted-price mode. Equity bands can jump around splits when adjustment is inconsistent, while crypto bands can differ across venues because each feed observes a different traded price.

代码、市场与时间周期

确认端点支持股票、外汇还是加密货币,能否选择日线、周线或分钟线;同时核对交易所标识、时区与复权规则。

计算周期与标准差倍数

常见默认值是 20 周期均线与 2 倍标准差,但不能假设所有接口一致。文档允许时应明确传入周期、均线类型和标准差参数。

上轨、中轨、下轨 JSON

返回应包含带时间戳的上轨、中轨、下轨,以及代码、周期和计算元数据。验证数值类型、时间顺序、缺失值和预热区间。

API Key、限频、时效与许可

检查鉴权、每分钟或每日额度、历史深度、实时行情权限、缓存、署名、再分发、商业用途和错误结构。

带宽与 %B 定义

部分端点还会返回带宽与 %B,但公式和零带宽处理必须有明确说明。常见定义是用中轨归一化上下轨宽度,并计算价格在上下轨区间中的位置。应保留输入价格、缩放方式和空值规则,不能把名称相似的字段直接视为等价。

Squeeze 与突破标签

“波动收缩”必须说明带宽阈值、比较历史和确认规则;触碰或穿越轨道并不自动构成突破或反转。应优先保存原始轨道与带宽,再在应用中对提醒逻辑进行版本化,避免继承供应商不透明的标签。

交易时段与价格源对齐

保存交易所或交易场所、时区、正常或延长交易时段、K 线状态、源时间戳和复权模式。股票在拆股前后复权不一致时轨道会异常跳变;加密货币则可能因不同交易所观察到的成交价不同而产生差异。

Why two APIs can return different bands: the usual formula is middle = moving average, upper = middle + k × standard deviation, and lower = middle − k × standard deviation. Results still diverge when providers use SMA versus EMA, population versus sample standard deviation, adjusted versus raw prices, different session boundaries, or different warm-up histories. Treat those choices as part of the data contract—not as implementation trivia.

为什么两个接口会返回不同的布林带:常见公式是中轨等于移动平均线,上轨等于中轨加上 k 倍标准差,下轨等于中轨减去 k 倍标准差。但只要供应商在 SMA 与 EMA、总体标准差与样本标准差、复权价与原始价、交易日边界或预热历史长度上采用不同口径,结果就会出现差异。这些选择属于数据契约的一部分,不能当作无关紧要的实现细节。

Reproduce a five-price fixture by hand用五个价格手工复算固定样本

Use closing prices 100, 102, 101, 103, 104, a five-period simple moving average, and a multiplier of 2. The middle band is (100+102+101+103+104) ÷ 5 = 102. The squared deviations sum to 10. With population standard deviation (ddof=0), σ is √(10÷5) = 1.4142, so the upper band is 104.8284 and the lower band is 99.1716.

取收盘价 100、102、101、103、104,使用 5 周期简单移动平均和 2 倍标准差。中轨为 (100+102+101+103+104) ÷ 5 = 102,各价格与均值之差的平方和为 10。采用总体标准差(ddof=0)时,σ 为 √(10÷5) = 1.4142,所以上轨为 104.8284,下轨为 99.1716。

Convention计算口径Standard deviation标准差Upper / lower上轨 / 下轨Result结论
Population, ddof=0总体标准差,ddof=01.4142104.8284 / 99.1716Common in indicator libraries技术指标库中的常见口径
Sample, ddof=1样本标准差,ddof=11.5811105.1623 / 98.8377Wider bands from the same prices同一价格序列会得到更宽的轨道

Under the population convention, the last close of 104 gives %B = (104−99.1716) ÷ (104.8284−99.1716) = 0.8536. Bandwidth is (104.8284−99.1716) ÷ 102 = 5.55%. Some APIs scale %B to 85.36 instead of 0.8536 or return bandwidth as 0.0555 instead of 5.55%; field units must therefore be part of validation.

按总体标准差口径,最后一个收盘价 104 对应 %B = (104−99.1716) ÷ (104.8284−99.1716) = 0.8536,带宽为 (104.8284−99.1716) ÷ 102 = 5.55%。有些接口把 %B 返回为 85.36 而不是 0.8536,或把带宽返回为 0.0555 而不是 5.55%;因此字段单位也必须纳入验收。

Free technical indicator API options to evaluate可评估的免费 BOLL 指标接口

The sources below document indicator endpoints or pre-calculated Bollinger Bands. Treat the table as a verification shortlist, not an endorsement; free access and terms can change.

下列来源提供技术指标端点或预计算布林带。此表仅用于缩小验证范围,不代表对任何供应商背书;免费权限和条款可能变化。

Source来源Useful signal可用信号Verify before use使用前核对
Alpha VantageOfficial technical-indicator documentation includes BBANDS inputs for symbol, interval, time period, moving-average type, and deviations.官方技术指标文档包含 BBANDS,可设置代码、周期、均线类型和上下轨标准差。Current free-key quota, data freshness, market entitlement, output size, and production terms.当前免费 Key 配额、数据时效、市场授权、返回长度与生产条款。
Twelve DataIts indicator API documents Bollinger Bands for supported instruments and intervals.其指标 API 文档提供布林带,并支持多类标的与时间周期。Current free-plan credits, websocket versus REST access, exchange coverage, and real-time status.当前免费积分、WebSocket 与 REST 权限、交易所覆盖和实时状态。
indictrThe current product page advertises pre-calculated Bollinger Bands, JSON/CSV output, and a limited free tier.当前产品页展示预计算布林带、JSON/CSV 返回与限量免费套餐。Supported symbols, intervals, calculation parameters, historical depth, uptime, and terms.支持代码、周期、计算参数、历史深度、可用性和条款。
StockApiIts Chinese BOLL endpoint documents daily, weekly, and monthly queries with cycle and bandwidth parameters.中文 BOLL 接口文档支持日、周、月查询,并提供 cycle 与 bandwidth 参数。A-share coverage, adjustment method, update schedule, authentication, quota, and commercial license.A 股覆盖、复权方式、更新时间、鉴权、额度和商业许可。

Bollinger Bands API Python example and validation布林带 API Python 示例与验证

Normalize each provider response into one small contract before the indicator reaches a chart or signal engine. The field names below are illustrative; map the provider’s documented schema rather than assuming it already uses these names.

在指标进入图表或信号引擎之前,先把不同供应商的响应映射为一个精简的数据契约。下面的字段名仅用于示例;应依据供应商文档完成映射,不能假设原始响应恰好使用这些名称。

{
  "symbol": "AAPL",
  "interval": "1day",
  "period": 20,
  "deviation": 2,
  "moving_average": "SMA",
  "standard_deviation": "population",
  "adjusted": true,
  "values": [
    {"timestamp": "2026-07-31T20:00:00Z", "upper": "214.83", "middle": "210.10", "lower": "205.37"}
  ]
}

The validator deliberately uses Decimal and timezone-aware timestamps. Supply the API response as payload after handling authentication, HTTP status, rate limits, and provider-specific error objects.

下面的校验器使用 Decimal 和带时区的时间戳。完成鉴权、HTTP 状态、限流与供应商特定错误结构处理后,再把响应作为 payload 传入。

from datetime import datetime
from decimal import Decimal, InvalidOperation


def parse_utc(value: str) -> datetime:
    parsed = datetime.fromisoformat(value.replace("Z", "+00:00"))
    if parsed.tzinfo is None:
        raise ValueError("timestamp must include a timezone")
    return parsed


def validate_bollinger_payload(payload: dict) -> list[dict]:
    required_meta = {
        "symbol", "interval", "period", "deviation",
        "moving_average", "standard_deviation", "adjusted", "values"
    }
    missing = required_meta - payload.keys()
    if missing:
        raise ValueError(f"missing metadata: {sorted(missing)}")
    if int(payload["period"]) < 2 or Decimal(str(payload["deviation"])) <= 0:
        raise ValueError("period and deviation must be positive")

    rows = []
    previous_time = None
    for raw in payload["values"]:
        timestamp = parse_utc(raw["timestamp"])
        try:
            upper = Decimal(str(raw["upper"]))
            middle = Decimal(str(raw["middle"]))
            lower = Decimal(str(raw["lower"]))
        except (KeyError, InvalidOperation) as exc:
            raise ValueError("invalid band row") from exc
        if not upper >= middle >= lower:
            raise ValueError(f"band order failed at {timestamp.isoformat()}")
        if previous_time is not None and timestamp <= previous_time:
            raise ValueError("timestamps must be strictly increasing")
        rows.append({"timestamp": timestamp, "upper": upper,
                     "middle": middle, "lower": lower})
        previous_time = timestamp
    if not rows:
        raise ValueError("response contains no completed indicator rows")
    return rows

1. Send symbol, interval, period, and deviation

Keep the key server-side and use the documented URL, for example requests.get(url, params={"symbol":"AAPL","interval":"1day","time_period":20,"sd":2,"apikey":api_key}, timeout=20). Parameter names differ by provider.

2. Validate HTTP and JSON fields

Call raise_for_status(), parse JSON, then locate timestamped upper, middle, and lower band values. Reject error payloads, null rows, non-numeric strings, and unexpected schemas.

3. Recalculate a fixture and prevent look-ahead

For each valid row, confirm upper ≥ middle ≥ lower and timestamps are ordered as documented. Recalculate a fixed sample from the same source prices using the provider’s moving-average type, standard-deviation convention, adjustment mode, and window. Exclude warm-up rows and do not let an incomplete current bar or future revision enter a historical signal.

4. Respect limits, freshness, and licensing

Handle 401, 403, 429, and 5xx responses; cache only as allowed; record provider, retrieval time, source timestamp, adjustment method, and entitlement.

5. Test semantic failure cases

Include flat prices that create zero band width, missing candles, a still-forming interval, a corporate-action date, and a long warm-up window. Verify ordering, %B behavior, revisions, and whether the endpoint changes past values after source bars are corrected.

6. Monitor the calculation contract

Track freshness, null rate, band-order violations, fixture deviation, quota use, parameter defaults, schema changes, and methodology notices. If validation fails, label the indicator unavailable rather than carrying old bands into a new trading session.

1. 传入代码、周期与标准差倍数

把 API Key 放在服务端,按文档传入代码、时间周期、20 周期与 2 倍标准差。不同供应商的参数名不同,不要猜测路径或字段。

2. 验证 HTTP 与 JSON 字段

调用 raise_for_status() 并解析 JSON,定位带时间戳的上轨、中轨和下轨;拒绝错误结构、空行、非数值字符串和意外 schema。

3. 固定样本复算并避免前视偏差

对每条有效数据确认上轨 ≥ 中轨 ≥ 下轨,时间顺序符合文档;再使用相同源价格、均线类型、标准差口径、复权方式和窗口抽样复算。应排除预热阶段的空值,也不能让尚未收盘的当前 K 线或事后修订数据进入历史信号。

4. 遵守限频、时效与许可

处理 401、403、429 和 5xx;仅按许可缓存,并保存供应商、抓取时间、源时间戳、复权方法和行情权限。

5. 测试数据语义故障

样本应包含导致带宽为零的横盘价格、缺失 K 线、尚未完成的周期、一个公司行动日期和较长预热窗口,并验证轨道顺序、%B 行为、修订,以及底层 K 线更正后历史值是否变化。

6. 监控计算契约

持续跟踪新鲜度、空值率、轨道顺序异常、固定样本偏差、额度消耗、默认参数、Schema 变化和方法公告。验证失败时应把指标标记为不可用,不能把旧轨道沿用到新的交易时段。

Bar-state rule: calculate a historical signal only from bars that were complete at the decision time. A still-forming 10:35 five-minute bar, a backfilled missing session, or a split adjustment applied after the original run can all change prior bands. Store the bar-close time, completion status, adjustment mode, source revision, and calculation time. When an input changes, recompute the affected window and version the signal rather than silently overwriting it.

K 线状态规则:历史信号只能使用决策时已经完成的 K 线。仍在形成中的 10:35 五分钟 K 线、事后回补的缺失交易日,或原运行之后应用的拆股复权,都可能改变此前的布林带。应保存 K 线收盘时间、完成状态、复权方式、来源修订版本和计算时间;输入发生变化时,重新计算受影响窗口并为信号建立新版本,不能悄悄覆盖原结果。

How QVeris helps connect Bollinger Bands APIsQVeris 如何连接布林带指标能力

QVeris does not calculate or guarantee a provider’s indicators, grant exchange licenses, or promise trading outcomes. It helps developers and agents discover financial-data capabilities, inspect interfaces, and connect a selected external tool through a consistent workflow.

QVeris 不计算或保证供应商指标、不授予交易所行情许可,也不承诺交易结果。它帮助开发者与 Agent 发现金融数据能力、检查接口,并通过一致流程连接选定的外部工具。

  • Open the QVeris tool details for technical indicator and market-data capabilities.
  • Inspect parameters, outputs, authentication, supported markets, documentation, timestamps, and quotas before connecting.
  • Use the QVeris Capability Map to explore adjacent data tools; indicator data is not investment advice.
  • 使用 QVeris 工具详情搜索技术指标和行情数据能力。
  • 连接前检查参数、输出、鉴权、支持市场、文档、时间戳和额度。
  • 通过 QVeris 能力地图探索相邻数据工具;指标数据不构成投资建议。

Free Bollinger Bands API FAQ免费布林带指标 API 常见问题

Is there a free Bollinger Bands API?

Yes. Some providers offer a limited free key or trial. Verify symbols, intervals, freshness, quota, licensing, and current plan access.

What does a Bollinger Bands API return?

Look for timestamped upper, middle, and lower bands plus symbol, interval, period, deviation, and calculation metadata.

How do I get Bollinger Bands data in Python?

Call the documented endpoint, handle HTTP errors, parse JSON, validate the three bands, and confirm chronological ordering.

Can a Bollinger Bands API provide real-time data?

Some support intraday intervals, but real-time exchange data may require a paid entitlement. Inspect timestamps and plan notes.

有免费的布林带 API 吗?

有些供应商提供限量免费 Key 或试用。应核对标的、周期、时效、额度、许可和当前套餐权限。

布林带 API 返回什么?

应包含带时间戳的上轨、中轨、下轨,以及代码、周期、标准差倍数和计算元数据。

如何用 Python 获取布林带数据?

按文档调用端点,处理 HTTP 错误并解析 JSON,验证三条轨道和时间顺序。

布林带 API 能提供实时数据吗?

部分接口支持分钟级周期,但实时交易所行情可能需要付费权限。必须检查时间戳和套餐说明。

External reference links外部参考链接