How to Check Forex API Quotes with a Cross Rate

TickDB Research ·

A direct EUR/JPY quote and a rate calculated from EUR/USD and USD/JPY can disagree without either feed being broken. First check that the three quotes are fresh and close enough in time. Then compare their bid/ask intervals. A persistent gap is something to investigate, not evidence of an executable trade.

EUR, USD and JPY triangle, with a direct EUR/JPY leg and a route via USD

Build an interval, not a midpoint

EUR/USD is USD per euro. USD/JPY is JPY per dollar. Multiplication cancels USD, leaving JPY per euro. For positive quotes in those orientations, multiply bid by bid and ask by ask. Don't apply those formulas unchanged if you reverse a pair: the inverse bid is 1/ask, and the inverse ask is 1/bid.

In this synthetic example, EUR/USD is 1.1000–1.1002 and USD/JPY is 150.00–150.04. The implied EUR/JPY interval is 165.000000–165.074008. A direct EUR/JPY quote of 165.03–165.08 overlaps even though its midpoint differs. A quote of 165.10–165.13 does not overlap.

Synthetic interval 165.000000 to 165.074008 overlaps direct EUR/JPY 165.03 to 165.08

Reject mismatched timestamps before comparing

A snapshot can contain quotes captured at different times. Check both the age of the oldest quote and the difference between the earliest and latest source timestamps. Use one clock basis and one timestamp unit. For example, TickDB documents millisecond timestamps and bid and ask fields when present; don't silently replace a missing side with the last price. Align the product and methodology too: a reference rate, an indicative quote and a futures price aren't interchangeable.

This offline example uses a 1,000 ms age limit and a 250 ms skew limit to illustrate the branches. Choose real limits from the feed's measurement and your application's needs; neither value is a provider guarantee.

from decimal import Decimal as D

def check(eur_usd, usd_jpy, eur_jpy, now_ms, max_age=1000, max_skew=250):
    quotes = (eur_usd, usd_jpy, eur_jpy)
    if any(not bid.is_finite() or not ask.is_finite()
           or not (0 < bid <= ask) for bid, ask, _ in quotes):
        return "invalid_quote"
    ts = [q[2] for q in quotes]
    if max(ts) > now_ms or now_ms - min(ts) > max_age:
        return "check_freshness"
    if max(ts) - min(ts) > max_skew:
        return "not_comparable_yet"
    synthetic_bid = eur_usd[0] * usd_jpy[0]
    synthetic_ask = eur_usd[1] * usd_jpy[1]
    return ("overlap" if eur_jpy[0] <= synthetic_ask
            and eur_jpy[1] >= synthetic_bid else "investigate_gap")

eur_usd = (D("1.1000"), D("1.1002"), 9900)
usd_jpy = (D("150.00"), D("150.04"), 9950)
direct = (D("165.03"), D("165.08"), 10000)
gap = (D("165.10"), D("165.13"), 10000)

assert check(eur_usd, usd_jpy, direct, 10000) == "overlap"
assert check(eur_usd, usd_jpy, (*gap[:2], 9650), 10000) == "not_comparable_yet"
assert check(eur_usd, usd_jpy, gap, 10000) == "investigate_gap"
assert check(eur_usd, usd_jpy, direct, 11000) == "check_freshness"
assert check(eur_usd, usd_jpy, (D("166"), D("165"), 10000), 10000) == "invalid_quote"
assert check(eur_usd, usd_jpy, (*direct[:2], 10001), 10000) == "check_freshness"

At 350 ms of skew the example refuses to compare, even with fresh quotes. It flags the same disjoint numbers once the timestamps are aligned. Log the three pairs, both sides and source timestamps, and take another comparable sample before escalating. Repeated gaps can point to stale inputs, reversed pairs, different providers or instruments, or a problem further upstream. Overlap is a consistency check, not a guarantee of accuracy or execution.

Category coverage

Forex & metals
1,228
11/30/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 ·