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

Skript med en öppen källkod

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. Du kan ange den som favorit för att använda den i ett diagram.

Vill du använda det här skriptet i ett diagram?

Frånsägelse av ansvar