HTF Candle Range Box (Fixed to HTF Bars)
Feb 4, 2025

The HTF Candle Range Box (Fixed to HTF Bars) indicator visually projects the price range of the most recently closed higher-timeframe candles onto your current lower-timeframe chart to provide immediate structural context.
Usage
The HTF Candle Range Box (Fixed to HTF Bars) is used to identify key support and resistance zones derived from higher timeframes without switching charts.
- Market Context: A green box indicates a bullish HTF candle (e.g., closing above the previous HTF high), while a red box indicates a bearish one. Neutral blue/orange boxes suggest indecision or inside bars.
- Breakout Trading: Traders can monitor the current price action relative to the displayed HTF boxes. A "Confirmed Bullish" or "Confirmed Bearish" label appears when the current price breaks the high or low of the previous HTF range.
- Scalping & Intraday: By viewing 15-minute or 1-hour ranges on a 1-minute chart, scalpers can avoid trading against the prevailing HTF momentum or identify "fake-outs" when price fails to sustain a move outside the box.
Details
The script utilizes request.security with lookahead_off to ensure all data is non-repainting. It fetches the high, low, open, and close of the previous HTF candle ($[1]$) and the candle before that ($[2]$) to determine market bias.
The tool calculates the duration of the higher timeframe and draws a box spanning the exact number of lower-timeframe bars that correspond to that period. This "fixed" approach ensures the box only covers the relevant segment of the chart, keeping the workspace clean.
Settings
- First Higher Time Frame: Sets the resolution for the first range box (e.g., 15 minutes).
- Second Higher Time Frame: Sets the resolution for the second range box (e.g., 60 minutes), allowing for dual-timeframe analysis.
FAQ
How do I access HTF Candle Range Box (Fixed to HTF Bars)?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Does this indicator repaint?
No, the indicator is designed with fixed historical references (using index $[1]$) and only updates its primary range box once an HTF candle has fully closed.
Can I display two different timeframes at once?
Yes, the script includes two independent HTF blocks, allowing you to visualize two different higher timeframes (such as the 1H and 4H) simultaneously on your lower timeframe chart.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.