OPEN-SOURCE SCRIPT
HTF Candle Boxes with FVG

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.
© 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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.