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
179 lines of Pine Script v5 from Scripts/FVG Histogram.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Upward and downward gaps are displayed as colored bars, with smaller, insignificant gaps rendered transparent based on settings. In addition to the time-series plot, the script creates a right-hand histogram showing the statistical distribution and frequency of recent FVG sizes. Users can adjust lookback lengths for detecting exceptionally large gaps, configure histogram bin counts, and filter signals based on gap distribution bins.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Up move / Down move:
color
color.new(color.blue,0)
col_up
/
color
color.new(color.red,0)
col_dn
Lookback: Largest FVG
int
20
n_compare
Make bars transparent (Insignificant FVGs)
bool
true
transp_reduct
Show info label
bool
false
show_label2
info_txtcol
color
color.new(color.purple,0)
info_txtcol
Show histogram
bool
true
show_histogram
No. of observations
int
100
n_histogram
No. of bins
int
10
n_bins
Show frequency table info
bool
false
show_hist_info
Histogram color
color
color.new(color.orange,20)
col_hist
Filter signals (If FVG is at the first bin)
bool
false
signal_filter_hist
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.
Calculates continuous structural market bias by detecting swing high and low pivots (higher highs, higher lows, lower highs, and lower lows) using configurable left and right bar lookbacks. It assigns weighted values to classified pivots within a rolling windo
Nexural Transform is an oscillator indicator calculated in a separate pane that combines Fisher Transform mechanics with Cumulative Volume Delta momentum. It integrates volume-weighted price transforms, CVD acceleration, and order flow features like absorption
Calculates CRT session range boundaries and detects Turtle Soup setups to identify potential breakout signals. The script tracks session high, low, and midpoint values to determine intraday bias while measuring price break distances against ATR thresholds. It
Indicatorv5SMC / ICT / price actionSessions & time
This indicator calculates and plots virtual daily candlestick OHLC values shifted forward by several hours relative to the current time. By aggregating four-hour bar data from higher-timeframe requests, it constructs custom 24-hour periods and renders them as
Relative Structure Strength Index is an oscillator indicator that plots in a separate pane. It calculates the Relative Strength Index (RSI) using bar structure power derived from an external library, then smooths the resulting values with a customizable moving
BTMM Performance Tracker is a trade analytics indicator designed for Steve Mauro's Beat The Market Maker methodology. It tracks simulated trade executions driven by automated, manual, or external signal inputs to compute account performance, win rates, and ris