Skip to main content
Python function: getOHLCV()

Product Overview

Overview

Forex OHLCV provides standardized Open, High, Low, Close, and Volume bars for foreign exchange currency pairs. Tickers use the C: prefix convention (e.g., C:EURUSD for EUR/USD, C:GBPUSD for GBP/USD). The legacy =X suffix format (e.g., EUR=X) is also accepted. Unlike equities or crypto, forex OHLCV bars are derived from quoted bid/ask prices rather than executed trades. The global FX market is decentralized and over-the-counter, so there is no single consolidated trade tape. Instead, bars are constructed from the best bid/offer (BBO) quotes streaming from institutional-grade liquidity providers.

Data Pipeline

Quote-Based Aggregation

Forex bars are constructed from real-time best bid/offer (BBO) quote feeds:
  • Quote sourcing: BBO quotes are streamed from institutional FX liquidity providers, capturing the best available bid and ask prices at any given moment.
  • Mid-price bars: OHLCV bar prices (open, high, low, close) are derived from the mid-point of the bid/ask quotes.
  • Volume: Represents the number of quote updates (tick volume) within the bar window, not notional traded volume — since FX is OTC and has no consolidated trade tape.
  • No phantom bars: If no new quotes arrive within a time window, no bar is emitted. This transparently indicates periods without market activity.
  • Timestamps: All timestamps returned by scalarLib are in New York time.

Real-Time Delivery

  • BBO quotes: Real-time bid/ask prices with exchange identification and timestamps.
  • Minute aggregates: Minute-by-minute OHLC bars derived from BBO quotes, streamed continuously.
  • Historical bars: Custom date ranges and timeframes via REST.

Coverage

  • Currency pairs: 1,750+ pairs including all major, minor, and many exotic crosses.
  • Majors: EUR/USD, GBP/USD, USD/JPY, USD/CHF, AUD/USD, USD/CAD, NZD/USD.
  • Crosses: EUR/GBP, EUR/JPY, GBP/JPY, AUD/JPY, and hundreds more.
  • Exotics: USD/TRY, USD/ZAR, USD/MXN, EUR/PLN, and many more.
  • Daily history: Extensive historical data.
  • Intraday: Minute and hourly bars available.

Supported Modes

Ticker Convention

Forex tickers use the C: prefix with the pair in BASQUOTE format (no separator).

Querying the Data

Basic Usage

Parameters

Column Definitions

OHLCV Schema