Technical Indicator API Guide技术指标 API 指南

Free MACD API
Data, Limits & Python
免费 MACD API
数据、限制与 Python 接入

Find a free MACD API, inspect its MACD, signal, and histogram fields, then verify symbols, intervals, timestamps, quotas, and usage terms before integration.

寻找可免费调用的 MACD API,检查 MACD 线、信号线与柱状图字段,
并在接入前核对标的、周期、时间戳、额度与使用条款。

Free MACD API whiteboard showing symbol and interval selection, API request, MACD, signal and histogram fields, validation and caching 免费 MACD API 白板图,展示标的与周期选择、接口调用、MACD 线、信号线、柱状图、数据验证与缓存流程

TL;DR概览

Trend-momentum job

Retrieve MACD, signal, and histogram series for crossover, trend-strength, and momentum-change workflows—not one opaque buy or sell label.

Reproducible calculation

Preserve fast EMA, slow EMA, signal EMA, price source, adjustment policy, interval, seed method, and completed-bar status.

Internal consistency

Verify histogram equals MACD minus signal and compare a trailing sample with a local EMA implementation after sufficient warm-up.

Where QVeris helps

QVeris helps agents discover technical-analysis capabilities and inspect their required inputs before calling them.

趋势动量任务

获取 MACD、信号线和柱状图序列,用于交叉、趋势强度和动量变化,而不是只拿一个不透明买卖标签。

计算可复现

保存快 EMA、慢 EMA、信号 EMA、价格源、复权政策、周期、初始值方法和 K线完成状态。

内部一致性

验证柱状图等于 MACD 减信号线,并在充分预热后与本地 EMA 实现比较一段样本。

QVeris 如何帮助

QVeris 可帮助 Agent 发现技术分析能力、检查输入输出,再决定是否调用。

Free MACD API response fields and parameters免费 MACD API 的响应字段与参数

A MACD indicator API usually derives three series from price data: the MACD line, its signal line, and the histogram difference. Defaults often use 12- and 26-period exponential moving averages with a 9-period signal, but names, precision, source series, and warm-up behavior differ. Treat each provider’s documentation as authoritative.

MACD 技术指标 API 通常由价格数据计算三组序列:MACD 线、信号线和两者差值形成的柱状图。常见默认参数为 12、26 周期指数移动平均线与 9 周期信号线,但字段名、精度、输入价格和预热期处理各不相同,应以供应商文档为准。

Reconcile the three MACD series

Verify that histogram equals MACD minus signal within the provider’s rounding tolerance. Store all three values; do not reconstruct a missing line from a chart image or opaque status label.

Confirm EMA seeding and warm-up length

MACD depends on recursive exponential averages. Providers may seed with an SMA, the first value, or a longer hidden history, so early results can differ even with 12/26/9 parameters.

Preserve fast, slow, signal, and price-source settings

Record the two EMA periods, signal EMA, close or adjusted-close input, interval, and adjustment policy. Swapping fast and slow changes the sign and interpretation.

Use completed bars for crossover decisions

A MACD crossover can appear and disappear while the current bar is forming. For reproducible alerts and backtests, label provisional values and confirm the signal on the completed bar.

Verify histogram sign and scale

Most providers define histogram as MACD minus signal, but some charting systems reverse the sign or multiply the difference for display. Check the documented equation and verify it numerically. Do not infer bullish or bearish state from a field named histogram until its sign convention is known.

Separate crossover, zero-line, and momentum rules

A MACD-line crossover, signal-line crossover, zero-line crossing, and expanding histogram describe different events. Store the underlying three series and implement strategy labels in the application with explicit confirmation and cooldown rules instead of accepting an opaque buy or sell flag.

Align multi-timeframe inputs

Daily, hourly, and minute MACD values have different histories and completion times. A combined signal is point-in-time safe only when every contributing candle had closed. Preserve interval, session, timezone, source-bar timestamp, and retrieval time for each series.

核对三条 MACD 序列

在供应商舍入容差内验证柱状图等于 MACD 减信号线,并保存全部三项,不能根据图像或不透明状态标签反推缺失序列。

确认 EMA 初始值与预热长度

MACD 依赖递归指数均线。供应商可能用 SMA、首个值或更长的隐藏历史初始化,所以即使参数同为 12/26/9,早期结果也可能不同。

保留快慢线、信号与价格源设置

记录两条 EMA 周期、信号 EMA、收盘或复权收盘输入、时间间隔和复权政策。快慢周期互换会改变符号和解释。

用已完成 K线确认交叉信号

当前 K线形成期间,MACD 交叉可能出现后又消失。为了让告警和回测可复现,应标记临时值,并在 K线完成后确认信号。

核对柱状图符号与缩放

多数供应商把柱状图定义为 MACD 减信号线,但部分图表系统会反转符号或为了展示而放大差值。必须核对文档公式并用数值验证。在不清楚符号约定前,不能仅凭名为 histogram 的字段判断看涨或看跌。

区分交叉、零轴与动量规则

MACD 线交叉、信号线交叉、穿越零轴和柱状图扩张描述的是不同事件。应保存三条底层序列,并在应用中通过明确的确认与冷却规则生成策略标签,而不是直接采用不透明的买卖信号。

对齐多周期输入

日线、小时线与分钟线 MACD 使用不同历史长度和完成时间。只有所有参与计算的 K 线在决策时点都已收盘,组合信号才不会泄漏未来数据。每条序列都应保留周期、交易时段、时区、底层 K 线时间和抓取时间。

How to compare free technical indicator APIs如何比较免费技术指标 API

Requirement要求What to inspect检查内容Why it matters为什么重要Failure signal风险信号
Endpoint access端点权限Is MACD included in the free tier, demo, or paid plan?MACD 属于免费层、演示还是付费端点?A free key may not unlock every indicator.免费密钥可能无法调用全部指标。Pricing and docs disagree.价格页与文档不一致。
Fields字段MACD, signal, histogram, timestamps, metadata.MACD、信号线、柱状图、时间戳、元数据。Determines whether the response answers the task.决定响应能否直接满足任务。Only a chart or opaque score.只提供图表或不透明评分。
Parameters参数Symbol, interval, fast/slow/signal periods, series type.标的、周期、快慢线与信号周期、价格类型。Makes output reproducible and comparable.使输出可复现、可比较。Undocumented fixed defaults.固定默认值却没有说明。
Quota & rights额度与许可Request weights, 429 behavior, caching, display, storage.请求权重、429 行为、缓存、展示与存储许可。Defines safe polling and permitted use.决定安全轮询方式与允许用途。“Unlimited” without written terms.宣称“不限量”却无书面条款。

MACD API for Python: a safe integration pathPython 获取 MACD 数据:安全接入步骤

1. Confirm symbol, asset class, and interval

Resolve the instrument and venue first, then choose a supported interval such as daily or one hour. Do not assume the same ticker maps across providers.

2. Send one documented MACD request

Use the provider’s official HTTP or Python example with an API key stored on the server. Inspect the unmodified JSON before writing a mapper.

3. Normalize MACD JSON data

Parse timestamps with timezone awareness, convert numeric strings safely, preserve null warm-up values, and map MACD, signal, and histogram explicitly.

4. Add rate-limit handling and caching

Respect request weights, back off after 429 responses, cache by completed-bar cadence, and retain provider, parameters, and retrieval timestamps.

5. Recalculate a fixed MACD fixture

Save enough close prices to cover the slow EMA and signal warm-up, then reproduce all three series independently. Compare seed behavior, null rows, timestamps, precision, and histogram identity within a stated tolerance. Include a missing interval and a split-adjusted stock example.

6. Monitor revisions and crossover stability

Track source-bar freshness, candle status, schema changes, historical revisions, quota use, and disagreement with the fixture. If a provisional crossover disappears before close or a backfill changes an earlier signal, preserve the change history instead of overwriting the evidence.

1. 确认标的、资产类型与周期

先解析证券和交易所,再选择日线或小时等受支持周期,不要假设不同供应商使用相同代码映射。

2. 按官方文档发送 MACD 请求

参考供应商提供的 HTTP 或 Python 示例,将 API 密钥保存在服务端,并先检查未经修改的原始 JSON。

3. 规范化 MACD JSON 数据

按时区解析时间戳,安全转换数值字符串,保留预热期空值,并明确映射 MACD、信号线和柱状图。

4. 添加限流处理与缓存

遵守请求权重,遇到 429 时退避,按已完成 K 线缓存,并记录供应商、计算参数与抓取时间。

5. 用固定 MACD 样本复算

保存足够覆盖慢速 EMA 与信号线预热的收盘价,再独立复算全部三条序列。按照明确容差比较初始值、空值行、时间戳、精度和柱状图恒等关系,并加入一个缺失周期与一个拆股复权股票样本。

6. 监控修订与交叉稳定性

跟踪底层 K 线新鲜度、收盘状态、Schema 变化、历史修订、额度消耗和固定样本偏差。如果临时交叉在收盘前消失,或历史回补改变旧信号,应保留变化历史,而不是覆盖原始证据。

Provider-neutral Python validation. Map the selected API’s field names into timestamp, macd, signal, and histogram, then validate each row before storing it. This example deliberately checks structure and arithmetic without inventing a provider URL or authentication scheme.

与供应商无关的 Python 校验。 先把所选 API 的字段映射为 timestampmacdsignalhistogram,再逐行校验后入库。下面的示例只验证数据结构与计算关系,不虚构供应商地址或认证方式。

from dataclasses import dataclass
from datetime import datetime
from decimal import Decimal, InvalidOperation


@dataclass(frozen=True)
class MacdPoint:
    timestamp: datetime
    macd: Decimal
    signal: Decimal
    histogram: Decimal


def parse_macd_row(row: dict, tolerance=Decimal("0.000001")) -> MacdPoint:
    required = {"timestamp", "macd", "signal", "histogram"}
    missing = required.difference(row)
    if missing:
        raise ValueError(f"Missing MACD fields: {sorted(missing)}")

    timestamp = datetime.fromisoformat(
        str(row["timestamp"]).replace("Z", "+00:00")
    )
    if timestamp.tzinfo is None:
        raise ValueError("MACD timestamp must include a timezone")

    try:
        macd = Decimal(str(row["macd"]))
        signal = Decimal(str(row["signal"]))
        histogram = Decimal(str(row["histogram"]))
    except InvalidOperation as exc:
        raise ValueError("MACD fields must be decimal numbers") from exc

    if abs((macd - signal) - histogram) > tolerance:
        raise ValueError("Histogram does not equal MACD minus signal")

    return MacdPoint(timestamp, macd, signal, histogram)

Run the parser on completed bars only, preserve null warm-up rows separately, and compare a fixed trailing window with a local EMA calculation. A passing arithmetic check confirms internal consistency; it does not prove that the provider used the same seed, price source, or adjustment policy as your strategy.

仅对已完成 K 线运行该解析器,单独保留预热期空值,并把固定尾部窗口与本地 EMA 计算结果比较。通过计算关系校验只能证明响应内部一致,不能证明供应商采用了与策略相同的初始值、价格来源或复权政策。

Use QVeris to discover MACD API capabilities用 QVeris 发现 MACD API 能力

QVeris is a capability-routing layer, not a market-data vendor and not a promise that a third-party MACD endpoint is free. It can help an agent search for technical-analysis capabilities, inspect inputs and outputs, and call a selected tool under that tool’s documented terms.

QVeris 是能力路由层,不是行情供应商,也不承诺第三方 MACD 端点免费。它可以帮助 Agent 搜索技术分析能力、检查输入输出,并遵循目标工具的公开条款进行调用。

  • Open the QVeris tool details for MACD and technical-indicator capabilities.
  • Inspect symbols, intervals, calculation parameters, response schema, provider identity, and limitations before calling.
  • Use the QVeris documentation to connect the selected capability to an agent workflow.
  • 打开 QVeris MACD 工具详情,查看参数与指标输出。
  • 调用前检查标的、周期、计算参数、响应结构、供应商身份和公开限制。
  • 参考 QVeris 文档,把选定能力接入 Agent 工作流。

Free MACD API FAQ免费 MACD API 常见问题

Is there a free API for MACD data?

Yes. Some providers offer free tiers or demos for pre-calculated MACD. Check the current pricing and endpoint documentation because a free key may exclude the MACD function.

What does a MACD API return?

A useful response normally includes timestamps, MACD values, signal values, and histogram values. Also inspect calculation parameters, ordering, precision, and null warm-up rows.

How do I get MACD data in Python?

Send an authenticated HTTP request with a symbol and interval, parse the JSON, convert numeric strings safely, preserve timestamps, and handle rate limits and errors.

Can I get real-time MACD data from a free API?

Possibly, but source-market entitlements and free-plan rules vary. Verify the underlying bar timestamp and documented delay instead of inferring freshness from response speed.

有免费的 MACD API 吗?

部分供应商为预计算 MACD 提供免费层或试用额度,但免费密钥可能不包含该端点,因此应同时检查最新价格页和接口文档。

MACD 接口会返回什么?

常见字段包括时间戳、MACD 线、信号线与柱状图,还应检查计算参数、数据顺序、精度和预热期空值。

如何用 Python 获取 MACD 数据?

携带密钥、标的和周期发送 HTTP 请求,解析 JSON,安全转换数值,保留时间戳,并处理限流与错误。

免费接口能返回实时 MACD 吗?

有可能,但取决于底层行情权限和免费层规则。应检查 K 线时间戳与官方延迟说明,不要仅凭接口响应速度判断数据是否实时。

Authoritative references and next steps参考资料与接入下一步