Live order book & FX data charts
Real-time order book depth, bid/ask spreads, and quantitative trading analytics
Market Depth - EURUSD
Visualizes the order book snapshot for the selected currency pair, showing the price and cumulative volume at each bid and ask level. The area under the green (bids) and red (asks) lines represents market liquidity on both sides, with the mid-price and top volume “walls” highlighted for quick identification of major support and resistance.
WITH snapshot AS (SELECT timestamp, bids, asksFROM market_dataWHERE dateadd('m', -10, now()) < timestamp and symbol = 'EURUSD'ORDER BY timestamp DESCLIMIT 1),bid_levels AS (SELECT timestamp, 'bid' AS side, bids[1,1] AS price, bids[2,1] AS volume FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,2], bids[2,2] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,3], bids[2,3] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,4], bids[2,4] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,5], bids[2,5] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,6], bids[2,6] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,7], bids[2,7] FROM snapshot),ask_levels AS (SELECT timestamp, 'ask' AS side, asks[1,1] AS price, asks[2,1] AS volume FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,2], asks[2,2] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,3], asks[2,3] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,4], asks[2,4] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,5], asks[2,5] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,6], asks[2,6] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,7], asks[2,7] FROM snapshot),bid_cum AS (SELECTtimestamp,side,price,volume,SUM(volume) OVER (ORDER BY price DESC) AS cum_volumeFROM bid_levelsWHERE price IS NOT NULL),ask_cum AS (SELECTtimestamp,side,price,volume,SUM(volume) OVER (ORDER BY price ASC) AS cum_volumeFROM ask_levelsWHERE price IS NOT NULL)SELECT * FROM bid_cumUNION ALLSELECT * FROM ask_cumORDER BY side, price;
Market Depth - GBPUSD
Visualizes the order book snapshot for the selected currency pair, showing the price and cumulative volume at each bid and ask level. The area under the green (bids) and red (asks) lines represents market liquidity on both sides, with the mid-price and top volume “walls” highlighted for quick identification of major support and resistance.
WITH snapshot AS (SELECT timestamp, bids, asksFROM market_dataWHERE dateadd('m', -10, now()) < timestamp and symbol = 'GBPUSD'ORDER BY timestamp DESCLIMIT 1),bid_levels AS (SELECT timestamp, 'bid' AS side, bids[1,1] AS price, bids[2,1] AS volume FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,2], bids[2,2] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,3], bids[2,3] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,4], bids[2,4] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,5], bids[2,5] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,6], bids[2,6] FROM snapshotUNION ALL SELECT timestamp, 'bid', bids[1,7], bids[2,7] FROM snapshot),ask_levels AS (SELECT timestamp, 'ask' AS side, asks[1,1] AS price, asks[2,1] AS volume FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,2], asks[2,2] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,3], asks[2,3] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,4], asks[2,4] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,5], asks[2,5] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,6], asks[2,6] FROM snapshotUNION ALL SELECT timestamp, 'ask', asks[1,7], asks[2,7] FROM snapshot),bid_cum AS (SELECTtimestamp,side,price,volume,SUM(volume) OVER (ORDER BY price DESC) AS cum_volumeFROM bid_levelsWHERE price IS NOT NULL),ask_cum AS (SELECTtimestamp,side,price,volume,SUM(volume) OVER (ORDER BY price ASC) AS cum_volumeFROM ask_levelsWHERE price IS NOT NULL)SELECT * FROM bid_cumUNION ALLSELECT * FROM ask_cumORDER BY side, price;
L2 Market Data · Market Depth Charts · Bid-Ask Spread Analytics
Analyze order book depth level-by-level, compute cumulative volume profiles, and monitor spread in real-time
Spread and Volume per second - EURUSD
Displays a rolling table of the most recent seconds for the selected currency pair, summarizing the current average spread (difference between best ask and best bid) along with the aggregated bid and ask volumes. Use this to monitor how liquidity and price tightness evolve in real time, and spot sudden widening or bursts in traded volume.
SELECTtimestamp AS Time,avg(asks [ 1, 1 ] - bids [ 1, 1 ]) AS Spread,sum(bids [ 1, 1 ] * bids [ 2, 1 ]) AS Bid_Volume,sum(asks [ 1, 1 ] * asks [ 2, 1 ]) AS Ask_VolumeFROM market_dataWHERE dateadd('m', -1, now()) < timestamp AND symbol = 'EURUSD'SAMPLE BY 1sORDER BY timestamp DESCLIMIT 6;
Spread and Volume per second - GBPUSD
Displays a rolling table of the most recent seconds for the selected currency pair, summarizing the current average spread (difference between best ask and best bid) along with the aggregated bid and ask volumes. Use this to monitor how liquidity and price tightness evolve in real time, and spot sudden widening or bursts in traded volume.
SELECTtimestamp AS Time,avg(asks [ 1, 1 ] - bids [ 1, 1 ]) AS Spread,sum(bids [ 1, 1 ] * bids [ 2, 1 ]) AS Bid_Volume,sum(asks [ 1, 1 ] * asks [ 2, 1 ]) AS Ask_VolumeFROM market_dataWHERE dateadd('m', -1, now()) < timestamp AND symbol = 'GBPUSD'SAMPLE BY 1sORDER BY timestamp DESCLIMIT 6;
Purpose-built for FX Order Book Data
Store market depth snapshots with ARRAY columns and query them using capital-markets SQL functions
Top-of-book Levels vs Core Price - EURUSD
Compares the best bid in the order book (from L2 market data) using an ASOF JOIN against the corresponding “core” quote price from upstream sources (e.g., ECNs). Then it finds at which level we could trade the core price bid volume. If no matching level is found, Level and Price will be empty. This table helps detect price alignment issues, latency, or anomalies between your live order book and reference prices provided by liquidity venues.
WITH p AS (SELECTtimestamp,bid_price,bid_volume,symbol,ecnFROM core_priceWHERE dateadd('m', -1, now()) < timestamp AND symbol = 'EURUSD'LIMIT -6), levels AS (SELECTmarket_data.timestamp AS md_timestamp,insertion_point(bids [ 2 ], bid_volume) AS level,bids [ 1 ] [ insertion_point(bids [ 2 ], bid_volume) ] AS price,bids [ 2 ] [ insertion_point(bids [ 2 ], bid_volume) ] AS volume,p.timestamp,p.bid_price,p.bid_volume AS bid_volume,p.ecnFROM p ASOF JOIN market_data ON symbol)SELECTmd_timestamp AS MarketData_Time,CASE WHEN price IS null THEN null ELSE level end AS Level,Price,Volume,timestamp AS CorePrice_Time,bid_price AS Bid_Price,bid_volume1 AS Bid_Volume,ecn AS ECNFROM levels;
Top-of-book Levels vs Core Price - GBPUSD
Compares the best bid in the order book (from L2 market data) using an ASOF JOIN against the corresponding “core” quote price from upstream sources (e.g., ECNs). Then it finds at which level we could trade the core price bid volume. If no matching level is found, Level and Price will be empty. This table helps detect price alignment issues, latency, or anomalies between your live order book and reference prices provided by liquidity venues.
WITH p AS (SELECTtimestamp,bid_price,bid_volume,symbol,ecnFROM core_priceWHERE dateadd('m', -1, now()) < timestamp AND symbol = 'GBPUSD'LIMIT -6), levels AS (SELECTmarket_data.timestamp AS md_timestamp,insertion_point(bids [ 2 ], bid_volume) AS level,bids [ 1 ] [ insertion_point(bids [ 2 ], bid_volume) ] AS price,bids [ 2 ] [ insertion_point(bids [ 2 ], bid_volume) ] AS volume,p.timestamp,p.bid_price,p.bid_volume AS bid_volume,p.ecnFROM p ASOF JOIN market_data ON symbol)SELECTmd_timestamp AS MarketData_Time,CASE WHEN price IS null THEN null ELSE level end AS Level,Price,Volume,timestamp AS CorePrice_Time,bid_price AS Bid_Price,bid_volume1 AS Bid_Volume,ecn AS ECNFROM levels;
Extreme Performance
Low-latency, Millions of rows per second, instant analytics at terabyte scale
OHLC - Bids - 5secs - (EURUSD)
Candlestick chart summarizing price action using the best bid from the order book, aggregated into 5-second intervals. Each candlestick shows the open, high, low, and close bid price, along with traded volume. Ideal for visualizing price trends, volatility, and market regime changes over time. Data is queried from a live table and aggregated on the fly.
selecttimestamp,first(bids[1,1]) open,max(bids[1,1]) high,min(bids[1,1]) low,last(bids[1,1]) close,sum(bids[2,1]) total_volumefrom market_datawhere dateadd('m', -5, now()) < timestamp and symbol = 'EURUSD'sample by 5s;
OHLC - Bids - 5secs - (GBPUSD)
Candlestick chart summarizing price action using the best bid from the order book, aggregated into 5-second intervals. Each candlestick shows the open, high, low, and close bid price, along with traded volume. Ideal for visualizing price trends, volatility, and market regime changes over time. Data is queried from a live table and aggregated on the fly.
selecttimestamp,first(bids[1,1]) open,max(bids[1,1]) high,min(bids[1,1]) low,last(bids[1,1]) close,sum(bids[2,1]) total_volumefrom market_datawhere dateadd('m', -5, now()) < timestamp and symbol = 'GBPUSD'sample by 5s;
Interactive SQL
Click SHOW QUERY to inspect the live QuestDB statements behind every panel
VWAP - RSI 12h - Bollinger Bands (20,2) (EURUSD)
Multi-layered chart, overlaid on OHLC candles, combining three technical indicators for the selected symbol: • VWAP: Shows the Volume-Weighted Average Price, a key benchmark for execution quality. • RSI (12h): The Relative Strength Index, computed over 12-hour rolling windows, highlights overbought/oversold conditions and price momentum. • Bollinger Bands (20,2): Plots a 20-period moving average with ±2 standard deviations, indicating price volatility and potential breakout/reversal zones. Each period is 15 minutes, so the simple moving average (SMA) covers a 6-hour window.
WITH sampled AS (SELECTtimestamp, symbol,total_volume,((open+close)/2) * total_volume AS traded_valueFROM market_data_ohlc_1mWHERE date_trunc('day', now()) < timestampANDsymbol IN 'EURUSD'), cumulative AS (SELECT timestamp, symbol,SUM(traded_value)OVER (ORDER BY timestamp) AS cumulative_value,SUM(total_volume)OVER (ORDER BY timestamp) AS cumulative_volumeFROM sampled), vwap as (SELECT timestamp, cumulative_value/cumulative_volume AS vwap FROM cumulative)SELECT * FROM vwap;
VWAP - RSI 12h - Bollinger Bands (20,2) (GBPUSD)
Multi-layered chart, overlaid on OHLC candles, combining three technical indicators for the selected symbol: • VWAP: Shows the Volume-Weighted Average Price, a key benchmark for execution quality. • RSI (12h): The Relative Strength Index, computed over 12-hour rolling windows, highlights overbought/oversold conditions and price momentum. • Bollinger Bands (20,2): Plots a 20-period moving average with ±2 standard deviations, indicating price volatility and potential breakout/reversal zones. Each period is 15 minutes, so the simple moving average (SMA) covers a 6-hour window.
WITH sampled AS (SELECTtimestamp, symbol,total_volume,((open+close)/2) * total_volume AS traded_valueFROM market_data_ohlc_1mWHERE date_trunc('day', now()) < timestampANDsymbol IN 'GBPUSD'), cumulative AS (SELECT timestamp, symbol,SUM(traded_value)OVER (ORDER BY timestamp) AS cumulative_value,SUM(total_volume)OVER (ORDER BY timestamp) AS cumulative_volumeFROM sampled), vwap as (SELECT timestamp, cumulative_value/cumulative_volume AS vwap FROM cumulative)SELECT * FROM vwap;
Try it yourself
Ready to store FX market data? Follow our tutorial series on building Grafana dashboards
Bid vs Ask Volume (30s) - BBO (1s) - (EURUSD)
Time series chart comparing the aggregated bid and ask volumes over 30-second intervals, alongside the best bid and offer (BBO) price at 1-second granularity. Useful for monitoring shifts in market pressure, liquidity imbalances, and rapid changes in top-of-book pricing.
SELECTtimestamp time,symbol,sum(bids [ 1, 1 ] * bids [ 2, 1 ]) AS bid,-1 * sum(asks [ 1, 1 ] * asks [ 2, 1 ]) AS askFROMmarket_dataWHERE dateadd('m', -30, now()) < timestamp AND symbol IN 'EURUSD'SAMPLE BY 30s;
Bid vs Ask Volume (30s) - BBO (1s) - (GBPUSD)
Time series chart comparing the aggregated bid and ask volumes over 30-second intervals, alongside the best bid and offer (BBO) price at 1-second granularity. Useful for monitoring shifts in market pressure, liquidity imbalances, and rapid changes in top-of-book pricing.
SELECTtimestamp time,symbol,sum(bids [ 1, 1 ] * bids [ 2, 1 ]) AS bid,-1 * sum(asks [ 1, 1 ] * asks [ 2, 1 ]) AS askFROMmarket_dataWHERE dateadd('m', -30, now()) < timestamp AND symbol IN 'GBPUSD'SAMPLE BY 30s;
Build your own on QuestDB
High performance ingest & slick visualizations.
Perfect for financial data and real-time analytics.