XCREENER Docs
XQLLanguage Reference

OHLCV Series

What open, high, low, close, and volume mean, how bars are ordered, and where the numbers come from.

close, open, high, low, and volume are the five bare series identifiers XQL resolves directly from candle data (see Series References). This page covers what each one actually represents, since that's easy to gloss over once they're just "the source argument to a function."

The Five Series

Each series describes one property of a single candle (bar) on the expression's timeframe:

SeriesMeaning
openThe first price of the bar's period
highThe highest price reached during the bar's period
lowThe lowest price reached during the bar's period
closeThe last price of the bar's period
volumeHow much traded (or, for some markets, how much activity occurred) during the bar's period: see volume Units Differ by Market below

A bar's period is determined entirely by the query's timeframe (or an explicit <timeframe>:: qualifier): an h4 bar's open/high/low/close/volume describe that 4-hour window, a d bar describes a full day, and so on.

Bar Ordering

Offset 0 (the default, no [-N] suffix) means the most recent bar available: it may still be in progress (mid-period), not necessarily closed. [-1] means one bar before that, [-2] two bars before, and so on. This is consistent across every series and every function:

close[-1]        // the previous bar's close
high[-2]         // the high two bars ago
sma(50)[-1]      // the 50-period sma as of one bar back

volume Units Differ by Market

volume is not a normalized, cross-market number: what it counts depends on the instrument's market:

  • CRYPTO instruments report base-asset traded volume for the bar (e.g. for BTCUSD, the number of BTC traded, not the USD notional value).
  • FOREX, INDICES, COMMODITIES, METALS instruments trade over-the-counter, with no central exchange and no single "shares traded" figure. Their volume is a count of price-update ticks during the bar, not a currency or contract amount: an activity proxy, not a traded-size figure.

Don't compare volume magnitudes across markets

A volume threshold tuned for a crypto pair (fractional base-asset units, can be large or tiny depending on the asset's price) has no consistent relationship to a volume threshold on a forex pair (an integer tick count). Build volume-based conditions (like the cookbook's volume recipes) per-market, using that instrument's own recent volume history (e.g. avg(volume, 20)) as the baseline, rather than a fixed constant reused across markets.

OTC Markets Price at the Mid

For FOREX/INDICES/COMMODITIES/METALS instruments, open/high/low/close are mid prices (the midpoint between the quoted bid and ask), not last-traded-price figures (OTC markets don't have a single "last trade" the way an exchange does). For CRYPTO instruments, prices are actual last-traded prices from the exchange's order book. Both are legitimate close values for their respective markets, but they aren't computed the same way underneath.

On this page