Fair Value Gap [LuxAlgo]

Fair Value Gaps (FVG) highlight imbalances areas between market participants and have become popular amongst technical analysts. The following script aims to display fair value gaps alongside the percentage of filled gaps and the average duration (in bar) before gaps are filled.

Users can be alerted when an FVG is filled using the alerts built-in this script.


  • Percentage: Threshold percentage used to detect impulse legs.
  • Auto Threshold: Use the cumulative mean of absolute relative price changes multiplied by 4 as threshold.
  • Show Last Unfilled Gaps: Number of recent bullish and bearish unfilled gaps to display. New unfilled gaps will discard older ones.
  • Show All Unfilled Gaps: Allows to display all unfilled gaps.
  • Timeframe: Timeframe of the price data used to detect FVG's


In practice, FVG's display areas of support (bullish FVG) and resistances (bearish FVG). Once a gap is filled, suggesting the end of the imbalance, we can expect the price to reverse.

This approach is more contrarian in nature, users wishing to use a more trend following approaching can use the identification of FVG as direct signals, going long with the identification of a bullish FVG, and short with a bearish FVG. No studies highlight the precision of such methods.

The gap height can be used to determine the degree of imbalance between buying and selling market participants.


Various techniques exist for the identification of FVG's, we use the following rules on our script:

Bullish FVG

  • low > high(t-2)
  • close(t-1) > high(t-2)
  • %change > threshold

Upper Bullish FVG = low
Lower Bullish FVG = high(t-2)

Bearish FVG

  • high < low(t-2)
  • close(t-1) < low(t-2)
  • %change < -threshold

Upper Bearish FVG = low(t-2)
Lower Bearish FVG = high

where %change = (close(t-1) - open(t-1)) / open(t-1) * 100.
릴리즈 노트:
Minor changes.

Get Access to LuxAlgo indicators:

Join our 100k+ community:

All scripts & content provided by LuxAlgo are for informational & educational purposes only. Past performance does not guarantee future results.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.


이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?