Temporal Candle Grid [JOAT]Temporal Candle Grid
Overview
Temporal Candle Grid is a multi-timeframe structural confluence indicator that automatically pairs the current chart timeframe with a logical higher timeframe (HTF), fetches the HTF's open, high, low, and close series using non-repainting request.security() calls, and renders the resulting HTF candle geometry as a precision box overlay on the lower timeframe chart. Confirmation counters, buy-side/sell-side liquidity labels, and Fair Value Gap detection operate on confirmed bars only, giving traders a clean, lag-aware view of where HTF price structure begins and ends.
Intelligent Auto-Pairing
The indicator contains a timeframe pairing table that maps the current chart to a contextually appropriate higher timeframe without any manual configuration:
- 1m chart → 15m HTF
- 5m chart → 1H HTF
- 15m chart → 4H HTF
- 1H chart → Daily HTF
- 4H chart → Weekly HTF
- Daily chart → Monthly HTF
This auto-pairing logic ensures the HTF candle shown is always meaningfully larger than the current view — avoiding the degenerate case of pairing a 5m chart with a 10m HTF, which provides almost no additional information.
Users may override the auto-pair by specifying a custom HTF via input.
Non-Repainting HTF Data
Four separate request.security() calls retrieve HTF open, high, low, and close using:
- close offset on the HTF series (current-bar data from the HTF is never used)
- barmerge.lookahead_off
This combination guarantees that the HTF values shown were already fixed before the current bar opened — making the indicator safe for signal generation and alert use without lookahead contamination.
HTF Candle Box Rendering
The HTF candle is rendered as a transparent box spanning the full high-to-low range, with an inner body box (open-to-close) rendered in the candle direction colour (teal for bullish, red for bearish). At each HTF boundary (detected via ta.change() on the HTF open), the previous candle's boxes are finalised and new boxes begin drawing. This creates a visual grid of HTF candles overlaid on the lower timeframe, making the internal structure of each HTF bar immediately visible.
Confirmation Counter for HTF Range Breaks
Rather than signalling the moment price crosses an HTF boundary, the engine counts consecutive closes above the HTF high (for bullish breaks) or below the HTF low (for bearish breaks). A break is only confirmed after the count reaches a configurable threshold (default 2 consecutive closes). This eliminates wick-driven false breaks that resolve within the same HTF session.
Buy-Side / Sell-Side Liquidity Labels (BSL / SSL)
When a confirmed HTF high break occurs, the BSL (buy-side liquidity) level is marked with an upward label at the HTF high. When a confirmed HTF low break occurs, an SSL (sell-side liquidity) label is stamped at the HTF low. These labels persist and serve as reference levels for future pullbacks — common targets in institutional liquidity analysis.
Fair Value Gap Detection
Running on the current timeframe, the FVG engine identifies three-bar price gaps:
- Bullish FVG: Current bar's low is above the high from two bars ago — a gap in downside coverage indicating aggressive buying
- Bearish FVG: Current bar's high is below the low from two bars ago — a gap in upside coverage indicating aggressive selling
FVG boxes are drawn spanning the gap range and extend forward for 30 bars, rendering as reference zones for expected price return.
HTF Candle Projection
On the last bar (barstate.islast), the current in-progress HTF candle is projected forward as a semi-transparent dashed box, giving traders a visual reference for the current HTF session's range as it develops in real time.
Dashboard
A compact table at the bottom right displays:
- Current chart TF and detected HTF
- HTF candle direction (BULL / BEAR)
- Current break confirmation count
- Number of active BSL / SSL levels
- FVG status (open / filled) for the most recent gap
Inputs Reference
- Custom HTF Override — leave blank for auto-pair, enter a TF string (e.g., "60") to override
- Confirmation Bars Required (2) — consecutive closes beyond HTF range before break is confirmed
- Show HTF Candle Boxes — toggles the HTF overlay
- Show BSL / SSL Labels — toggles liquidity sweep labels
- Show FVG Boxes — toggles fair value gap boxes
- FVG Lookback (50) — how many bars back to scan for active FVGs
- Max BSL / SSL Labels (10) — prevents label accumulation over long sessions
- Theme: Dark, Light, Auto
How to Use
1. Apply on a 5m, 15m, or 1H chart. The indicator auto-detects the appropriate HTF.
2. The HTF candle boxes show the full range of each higher-timeframe session. Price tends to respect the HTF open, high, and low as decision levels.
3. Wait for the confirmation counter to reach the threshold before treating a HTF range break as confirmed.
4. BSL labels above prior HTF highs and SSL labels below prior HTF lows indicate pools of resting orders — common institutional sweep targets.
5. FVG boxes within the current HTF candle body often act as intra-session return targets.
Non-Repainting Design
All HTF data uses close with lookahead_off. Break signals require barstate.isconfirmed. FVG detection is based entirely on confirmed historical bars. The projection box at barstate.islast is explicitly marked as in-progress and does not generate signals.
Limitations
- Auto-pairing is based on standard timeframe relationships. Non-standard chart intervals (e.g., 3m, 7m) default to the nearest logical pair.
- The confirmation counter approach adds 1–2 bars of lag to break signals. This is intentional and necessary for non-repainting accuracy.
- On very fast-moving instruments, HTF candle boxes may be violated frequently, limiting their utility as structural references.
- FVG relevance degrades significantly on very high timeframes (Daily+) where gaps are rare and may take weeks to fill.
Disclaimer
This indicator is for educational and informational purposes only. Multi-timeframe structure analysis describes historical price behaviour and does not guarantee any specific future market outcome. Conduct your own analysis and use proper risk management at all times.
Made with passion by officialjackofalltrades
Indicator


