XCREENER Docs
XQLCookbook

Multi-Timeframe

Combining a query's default timeframe with a <timeframe>:: qualifier.

Each recipe below is a complete core-logic body: drop it under your market/timeframe pragmas and adjust the thresholds to taste. Every query on this page has been parsed and evaluated against the current XQL grammar. See Timeframes & Offsets for the full <timeframe>:: rules.

Daily Trend Filter on an Hourly Dip

Runs on an h1 default timeframe, but gates the entry on the daily 200-period trend: a short-term oversold dip that's still inside a long-term uptrend:

rsi(14) < 30 and close > d::sma(200)

This is the same pattern used in the XQL overview's example query.

New 52-Week High

"52-week high" doesn't map to d::highest(high, 365): 365 daily bars blows past the 300-bar lookback ceiling. Map the calendar phrasing to weekly bars instead:

close >= w::highest(high, 52)

52 weekly bars comfortably clears the ceiling and is arguably a more natural reading of "52-week" anyway.

Cross-Timeframe RSI Confirmation

Requiring the same oversold condition on two timeframes at once filters out dips that are only momentary noise on the higher timeframe:

rsi(14) < 30 and h4::rsi(14) < 40

On an h1 query, this matches only when the hourly RSI is deeply oversold and the 4-hour RSI also shows some weakness: a stronger signal than either timeframe checked alone.

On this page