OPEN-SOURCE SCRIPT

Fair Value Gap [MyTradingCoder]

Introducing the "Fair Value Gap" indicator, a powerful tool designed to identify and visualize areas of potential market gaps where leftover orders may reside. This indicator utilizes price action analysis, specifically focusing on fair value gaps that occur between the current candle and the candle two bars prior.

The Fair Value Gap indicator draws customizable zones on the chart, representing bullish or bearish areas with distinct green or red colors. These zones highlight market gaps where price action has left a void, indicating the possibility of significant order activity in that region.

Key Features:

  • Liquidity Zone: Utilize the Fair Value Gap zones as areas of liquidity, offering potential entry points for trades.
  • Support/Resistance Indicator: Configure the indicator to extend beyond the initial breakout or gap fill, allowing it to act as a support/resistance zone indicator.


The Fair Value Gap indicator has several adjustable settings to customize its behavior according to your trading preferences. These settings include:

  • Invalidation Outcome: Choose how the fair value gap zone is treated when it becomes invalidated. Options include:
    -Stop Updating: Maintain the gap zone in its current state without further updates.
    -Delete: Completely remove the fair value gap from the screen.
  • Invalidation Method: Determine the logic that invalidates the fair value gap. Options include:
    -Gap Fill: Visually shrink the zone as price action closes the gap until it is completely filled, at which point it gets deleted entirely.
    -Number Of Breakouts: Invalidate the gap after a certain number of breaks or flips over the zone's border. Configure the allowed number of breakouts with the "Breakouts Until Invalidation" input.
    -Age Of Gap: Invalidate the gap after a specified number of bars have passed since its creation. Set the threshold with the "Bars Until Invalidation" input.
  • Color Customization: Customize the appearance of the fair value gap zones with various color inputs, including bullish and bearish border colors, middle line color (shared for both bullish and bearish gaps), bullish and bearish background colors.
  • Line Width: Adjust the width of the border lines and the center line within the fair value gap zone for better visual clarity.


Please note that the Fair Value Gap indicator is a valuable tool but should be used alongside other technical analysis methods to make well-informed trading decisions. It does not guarantee profitable trades but aims to provide insights into potential areas of interest.

Discover opportunities within market gaps and leverage the power of leftover orders with the Fair Value Gap indicator—an indispensable asset in your trading toolkit.
Candlestick analysiscandlestickpatternChart patternschartpatterntradingfairvaluegap

Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının yazarı komut dosyasını açık kaynak olarak yayınlamıştır, böylece yatırımcılar betiği anlayabilir ve doğrulayabilir. Yazar çok yaşa! Ücretsiz olarak kullanabilirsiniz, ancak bu kodun yayında yeniden kullanımı Ev kurallarına tabidir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?

Feragatname