OPEN-SOURCE SCRIPT

HTF Candle Boxes with FVG

412
HTF Candle Boxes with FVG — See the higher timeframe structure as live, expanding boxes on your low-timeframe chart, with Fair Value Gaps highlighted as they print.

© syouske. All rights reserved.


This indicator combines two views in one: a real-time rendering of the current higher timeframe (HTF) candle drawn as expanding wick / body / wick boxes, and a Fair Value Gap (FVG) overlay that draws every 3-bar imbalance forming inside that HTF candle's range. FVGs whose gap range overlaps the HTF opening zone (open ± ATR) are highlighted in a distinct color so price-action context near the open is immediately obvious.


Disclaimer

This indicator is a tool for analysis, not financial advice. Past signals do not guarantee future results. Always use proper risk management.


What Is a Fair Value Gap

An FVG is a 3-candle imbalance:

- Bullish FVG — the low of the current candle is above the high of the candle two bars back. The empty space between them is the gap.
- Bearish FVG — the high of the current candle is below the low of the candle two bars back.

A gap represents inefficiency that price often revisits. Until it is revisited, it marks the area where momentum was strongest.


HTF Candle Boxes

Each higher timeframe candle is rendered as three live zones that expand in real time:

- Upper wick zone — where price was rejected from the top
- Body zone (green/red) — the accepted range between open and close
- Lower wick zone — where price was rejected from the bottom
- Optional outer box wraps the full candle range
- Optional dashed midline through the body

The boxes grow bar by bar as the HTF candle develops, so you always see the current structure clearly on any lower timeframe chart.


Opening Zone

An ATR-sized band around the HTF open price (ATR length, multiplier, and source timeframe are all configurable). This zone is the reference for FVG highlighting. The box is hidden by default to keep the chart clean — turn on "Show opening zone box" to make it visible.


FVG Boxes

Any FVG that prints within the current HTF candle's wick range (htf_low to htf_high) is drawn as a box:

- The box covers the exact price range of the gap.
- It extends right as long as the gap stays open.
- It is removed when the gap is fully filled (mitigated) — price trades all the way back through to the far edge of the gap.
- Any still-open FVGs freeze at the next HTF candle open.

FVGs whose gap overlaps the opening zone are filled in cyan by default — these are the gaps printed near the HTF open price, the most context-rich imbalances. FVGs outside the opening zone use a subtle gray fill.


Customization

- HTF timeframe: 1H, 4H, or 1D
- HTF box colors (upper wick, body bull/bear, lower wick), borders, outer box, midline dash
- Opening zone: ATR length, multiplier, source timeframe (5m / 15m / 30m / 1H), visibility, fill and border colors
- FVG: minimum gap size (ATR multiple), bull/bear fill, "near opening range" fill (cyan by default), border color, visibility toggle


Recommended Use

- Chart timeframe: 1M, 3M, 5M, or 15M
- Works on any liquid market: forex, crypto, indices, futures
- Best used alongside higher timeframe bias and key S/R levels
- Pair with the standalone "HTF Candle Boxes" indicator for multi-HTF analysis


Alerts

- "FVG Near HTF Open" — any FVG (bull or bear) printed inside the opening zone
- "FVG Near HTF Open — Bullish" — bullish FVG only
- "FVG Near HTF Open — Bearish" — bearish FVG only

Set alerts to "Once per bar close" for best accuracy.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.