Forex OHLC vs. Bid/Ask: Can a Candle Tell You the Spread?

TickDB Research ·

No. A forex candle summarizes one price series over a period. The spread is the difference between the bid and ask at the same time. If your chart shows an OHLC candle but your backtest needs quote-based costs, keep the candles for the signal and use contemporaneous bid and ask quotes for the cost model. Do not treat the candle's high minus its low as the spread.

The same candle can hide different spreads

Imagine two EUR/USD quote streams observed at the same three times. They have identical midpoints: 1.10000, 1.10020 and 1.09990. In one stream, bid and ask are one pip apart at every observation. In the other, they are three pips apart. The midpoint OHLC candle is identical in both streams.

Synthetic comparison: the same midpoint candle can come from quotes one or three pips apart.

Synthetic EUR/USD quotes, not measured spreads. One pip is 0.0001 in this example.

from decimal import Decimal as D

midpoints = list(map(D, ["1.10000", "1.10020", "1.09990"]))
pip = D("0.0001")

def make_quotes(half_width):
    return [(mid - half_width, mid + half_width) for mid in midpoints]

def summarize(quotes):
    mids = [(bid + ask) / 2 for bid, ask in quotes]
    candle = (mids[0], max(mids), min(mids), mids[-1])
    return candle, [(ask - bid) / pip for bid, ask in quotes]

candle_a, spread_a = summarize(make_quotes(D("0.00005")))
candle_b, spread_b = summarize(make_quotes(D("0.00015")))
assert candle_a == candle_b
assert spread_a == [D(1)] * 3
assert spread_b == [D(3)] * 3

This counterexample is enough to show why no calculation on a midpoint candle alone can recover the actual spread. Even if a provider offers separate bid and ask candles, their highs and lows can occur at different times. Subtracting the two highs does not give you the maximum spread.

What to keep for a quote-based cost model

First, confirm what price series the candle represents. Do not assume every provider builds FX candles from midpoints. Then verify that your quote source returns both sides, that the timestamps are usable, and that you can tell whether the most recent quote was fresh enough at the point where your strategy would act.

When simulating an entry, use the ask side for a buy and the bid side for a sell, then model fees and any slippage separately. A quote records what was displayed, not what you could necessarily fill. Keep quotes and candles from identifiable sources and avoid joining a decision to a quote that arrived later. If the paired quote is missing or too old, mark that observation as unavailable or run a clearly labeled spread sensitivity analysis; do not present an assumed spread as a historical measurement.

TickDB's forex documentation distinguishes REST historical candles from live quote channels. Its snapshot reference documents bid and ask when available. If you're evaluating this setup for TickDB or another provider, check the exact pair and permissions first. A live quote or a history of OHLC bars does not establish access to historical paired quotes. If your source does not provide that history, collect paired live observations prospectively or use a separately verified historical source.

The quickest test: ask whether two quote histories could produce the same candle. If they could, the candle cannot prove what either history's spread was.

Category coverage

Forex & metals
1,228
11/27/2026

Explore related data tools

Related articles

What Does XAUUSD Mean? Read a Gold Quote Without Assuming a Contract

XAUUSD commonly denotes gold quoted in US dollars per troy ounce. It tells you how to read a price, not how much gold an order represents or which contract you are buying. Separating the quote unit from quantity and product terms makes a simple ounce-to-gram conversion useful without turning it into an invented lot calculator.

TickDB Research ·

Can You Use a Real-Time Forex API for Free? A Trial Has Limits

A free forex API can be useful for evaluating live quotes, but “free” does not necessarily mean ongoing access for a production application. Check the trial expiry, permitted currency pairs, request and subscription budgets, historical access, and usage rights separately. TickDB provides a concrete example: its documented Free plan is a seven-day trial, not an unlimited free production tier.

TickDB Research ·

XAUUSD Explained for Price Tracking and Alerts

XAUUSD quotes gold in US dollars per troy ounce. It is useful for following gold prices, building dashboards, and setting price alerts, but the symbol alone does not identify an executable price or tell you whether to buy or sell. For example, a synthetic bid of 2,400.00 and ask of 2,400.80 produce a midpoint of 2,400.40, but neither that calculation nor a threshold alert guarantees an execution price.

TickDB Research ·

Forex WebSocket Integration: Stream EUR/USD Quotes with Node.js and Recover After Disconnects

A live forex display needs a client that authenticates, subscribes to the right quote channel, and restores that subscription after a disconnect. A server-side Node.js collector can do this while keeping credentials out of the browser and tracking connection health separately from quote freshness. The implementation below uses documented EUR/USD bid/ask fields, validates incoming messages, and checks an application-level heartbeat; reconnecting resumes collection but does not recover missing ticks.

TickDB Research ·