1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
72 lines of Pine Script v5 from Scripts/3 Bar Gap.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
3 Bar Gap calculates displacement between the price boundaries of two bars ago and the current bar. To filter out market noise during quiet periods, gaps must exceed an Average True Range threshold. Valid bullish and bearish gaps are tracked in an internal array structure and drawn with customizable line styles. Traders can fine-tune the ATR period and multiplier sensitivity.
Three-bar fair value gap detection
Dynamic ATR volatility threshold filter
Customizable line colors for bullish and bearish gaps
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Threshold: ATR
int
20
atr_filter_len
x
float
0.5
atr_filter_multi
Colors for Up move / Down move:
color
color.new(color.blue,0)
col_up
/
color
color.new(color.red,0)
col_dn
Width of the line
int
2
linewidth
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This overlay indicator marks ICT liquidity void fills on the price chart and can show long and short signals. It places a Fibonacci level inside a displacement candle, defaulting to the midpoint, and draws lines in a chosen style. Optional filters limit the fi
This indicator maps market structure and supply and demand zones on the price chart. It marks validated and optional unvalidated swing highs and lows using a pivot length and extra confirmation bars. Consolidation and impulse moves are measured against ATR to
This indicator overlays options gamma-exposure levels, session VWAP bands, and intraday market structure tools directly on the price chart. It provides three modular components: strike walls with standard deviation bands and opening ranges, a gamma regime engi
This Pine Script indicator overlays institutional liquidity levels on the price chart. It identifies order block levels using pivot highs and lows, then draws mean reversion lines from the 20 and 50 period simple moving averages, a volatility range midpoint pr
This indicator combines six trading tools into a single chart overlay to optimize indicator limits. It calculates Bollinger Bands, projects weekend price boundaries, plots market structure elements like order blocks, breaker blocks, and MSB lines, marks New Yo
This indicator combines Centered Triangular Moving Average (TMA) bands offset by Average True Range (ATR) with Smart Money Concepts (SMC) market structure analysis on the price chart. It calculates upper, center, and lower bands alongside swing and internal ma