Indicator · Pine Script v5 · On the chart

ICT Balanced Price Range [TradingFinder] BPR | FVG + IFVG

by alvinng214· code credited to TFlab

This indicator plots ICT balanced price ranges together with fair value gaps and inversion fair value gaps on the price chart.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code90
Settings19inputs
LicenceNone statedfile: MPL-2.0
Last update2 months ago5 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

90 lines of Pine Script v5 from S1_Silver_Bullet/ICT Balanced Price Range [TradingFinder] BPR FVG + IFVG.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

ICT Balanced Price Range [TradingFinder] BPR FVG + IFVG.txt
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TFlab
//@version=5
indicator("ICT Balanced Price Range [TradingFinder]  BPR | FVG + IFVG" ,'ICT BPR TFlab', overlay = true, max_bars_back = 5000, max_boxes_count = 500,max_labels_count = 500, max_lines_count = 500 )

//import Libraries
    //import Order Block Drawing  Library
import TFlab/OrderBlockDrawing_TradingFinder/4 as Drawing
    //import FVG  Library
import TFlab/FVGDetectorLibrary/3 as FVG
    //import Alert Sender Library
import TFlab/AlertSenderLibrary_TradingFinder/1 as Alert
    //import Switching Colors Theme
import TFlab/Dark_Light_Theme_TradingFinder_Switching_Colors_Library/1 as SC
    //import Order Block Overlapping Drawing
import TFlab/OrderBlockOverlappingDrawing/1 as OLB





//Input
    //Global Setting
ShowAllIFVG = input.bool(true, 'Show All FVG & IFVG', group = 'Global Setting')
FVGVaP = input.int(500, 'FVG & IFVG Validity Period (Bar)' , group = 'Logic Parameter' , maxval = 4998 , minval = 10,
 tooltip = 'You can set the validity period of each FVG & IFVG based on the number of candles that have passed since the origin of the Order Block.', group = 'Global Setting')
SCMode = input.string('Light', 'Switching Colors Theme Mode', options = ['Off', 'Light', 'Dark'])
     //Balanced Price Range
showDBPR = input.bool(true, 'show Bullish BPR', group = 'Balanced Price Range',inline = 'DBPR')
showSBPR = input.bool(true, 'show Bearish BPR', group = 'Balanced Price Range',inline = 'SBPR')
DBPRColor = input.color(#16dcff69, '', group = 'Balanced Price Range',inline = 'DBPR')
SBPRColor = input.color(#f1a20f71, '', group = 'Balanced Price Range',inline = 'SBPR')
MLBPR = input.string('Proximal' , 'Mitigation Level BPR', ['Proximal', '50 % OB', 'Distal'], 
 tooltip= 'Using this entry, you can determine which level the price reacts to in a BPR.', group = 'Balanced Price Range')
    //Inversion Fair Value Gap
PShowDeIFVG = input.bool(false, ' Show Bearish IFVG & FVG', group = 'IFVG & FVG',inline = 'IDFVG')
PShowSuIFVG = input.bool(false, ' Show Bullish IFVG & FVG', group = 'IFVG & FVG',inline = 'ISFVG')
OCShowDeIFVG = input.color(#4caf4f27, '', group = 'IFVG & FVG',inline = 'IDFVG')
OCShowSuIFVG = input.color(#ff52522f, '', group = 'IFVG & FVG',inline = 'ISFVG')
MLIFVG = input.string('Proximal' , 'Mitigation Level  IFVG & FVG', ['Proximal', '50 % OB', 'Distal'], 
 tooltip= 'Using this entry, you can determine which level the price reacts to in a  IFVG & FVG.', group = 'IFVG & FVG')

PFVGFilter = input.bool(true, 'FVG Filter ............',  group = 'FVG' , inline = 'FVG Filter')
PFVGFilterType = input.string('Defensive', '', 
 ['Very Aggressive' , 'Aggressive' , 'Defensive' , 'Very Defensive'], group = 'FVG', inline = 'FVG Filter' ,
 tooltip = 'If it is "On", this filter will filter "FVGs" based on the width of the Zone.'  + 
 'From "Very Aggressive" to "Very Defensive" the width of the "FVG" decreases.')

AlertName = input.string('BPR [TradingFinder]', 'Alerts Name', group = 'Alert')
Alert_IFVG = input.string('On' , 'Alert BPR Mitigation' , ['On', 'Off'], 'If you turn on the Alert BPR Mitigation,' +
 'you can receive alerts and notifications after setting the "Alert".' , group = 'Alert')
Frequncy = input.string('Once Per Bar' , 'Message Frequency' , ['All', 'Once Per Bar' , 'Per Bar Close'], 'The triggering frequency. Possible values are: All'+ 
 ' (all function calls trigger the alert), Once Per Bar (the first function call during the bar triggers the alert), ' +  
 ' Per Bar Close (the function call triggers the alert only when it occurs during the last script iteration of the real-time bar,' +  
 ' when it closes). The default is alert.freq_once_per_bar.)', group = 'Alert')
UTC = input.string('UTC' , 'Show Alert time by Time Zone', group = 'Alert')


/////////////////////////////////
///////////////SCT///////////////
/////////////////////////////////

[CShowDeIFVG] = SC.SwitchingColorMode(OCShowDeIFVG , SCMode)
[CShowSuIFVG] = SC.SwitchingColorMode(OCShowSuIFVG , SCMode)
/////////////////////////////////
///////////////FVG///////////////
/////////////////////////////////

[DConditionFVG, DDFVG, DPFVG, BarDFVG, SConditionFVG, SDFVG, SPFVG, BarSFVG] = FVG.FVGDetector(PFVGFilter ? 'On' : 'Off', PFVGFilterType, false, false)


/////////////////////////////////////
///////////////Drawing///////////////
/////////////////////////////////////

    //OUTPUT ==> Alert Trigger
[Alert_DFVG, Alert_SIFVG, ProximalPrice_SIFVG, DistalPrice_SIFVG, Index_SIFVG] = Drawing.OBDrawing('Demand', DConditionFVG,DDFVG, DPFVG, BarDFVG, true, FVGVaP, MLIFVG, MLIFVG, ShowAllIFVG , ShowAllIFVG, PShowDeIFVG, PShowDeIFVG, CShowDeIFVG, CShowSuIFVG)
[Alert_SFVG, Alert_DIFVG, ProximalPrice_DIFVG, DistalPrice_DIFVG, Index_DIFVG] = Drawing.OBDrawing('Supply', SConditionFVG, SDFVG, SPFVG, BarSFVG, true, FVGVaP, MLIFVG, MLIFVG, ShowAllIFVG, ShowAllIFVG, PShowSuIFVG, PShowSuIFVG, CShowSuIFVG, CShowDeIFVG )




[Alert_DBPR] = OLB.OBOverlappingDrawing('Demand', DConditionFVG ,  DistalPrice_DIFVG,ProximalPrice_DIFVG, DDFVG, DPFVG, BarDFVG,true, FVGVaP, MLBPR, true, showDBPR,DBPRColor) 
[Alert_SBPR] = OLB.OBOverlappingDrawing('Supply', SConditionFVG ,  DistalPrice_SIFVG,ProximalPrice_SIFVG, SDFVG, SPFVG, BarSFVG,true, FVGVaP, MLBPR, true, showSBPR,SBPRColor)

///////////////////////////////////
///////////////Alert///////////////
///////////////////////////////////
Alert.AlertSender(Alert_DBPR  , Alert_IFVG, AlertName, 'Bullish', 'Order Block Signal', 'Full' ,Frequncy, UTC, 'Off', 'Long Position in Bullish BPR', open, high, low, close,0,0,0,0,0)
Alert.AlertSender(Alert_SBPR  , Alert_IFVG, AlertName, 'Bearish', 'Order Block Signal', 'Full' ,Frequncy, UTC, 'Off', 'Short Position in Bearish BPR', open, high, low, close,0,0,0,0,0)

Overview

ICT Balanced Price Range [TradingFinder] BPR | FVG + IFVG marks bullish and bearish BPR zones and optional FVG and IFVG boxes, then tracks mitigation at a proximal, midpoint, or distal level. Users set how long each gap remains valid in bars, filter gaps by zone width from very aggressive to very defensive, and switch a light or dark color theme. Alerts can fire when a BPR is mitigated, with frequency and time-zone options. It is an overlay indicator and does not place trades.

Details

Published by

alvinng214 on GitHub

Code credit

TFlab, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

SMC / ICT / price action, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Show All FVG & IFVGbooltrueShowAllIFVG
FVG & IFVG Validity Period (Bar)int500FVGVaP
Switching Colors Theme ModestringLightSCMode
show Bullish BPRbooltrueshowDBPR
show Bearish BPRbooltrueshowSBPR
DBPRColorcolor#16dcff69DBPRColor
SBPRColorcolor#f1a20f71SBPRColor
Mitigation Level BPRstringProximalMLBPR
Show Bearish IFVG & FVGboolfalsePShowDeIFVG
Show Bullish IFVG & FVGboolfalsePShowSuIFVG
OCShowDeIFVGcolor#4caf4f27OCShowDeIFVG
OCShowSuIFVGcolor#ff52522fOCShowSuIFVG
Show all 19 settings
SettingTypeDefaultVariable
Mitigation Level IFVG & FVGstringProximalMLIFVG
FVG Filter ............booltruePFVGFilter
PFVGFilterTypestringDefensivePFVGFilterType
Alerts NamestringBPR [TradingFinder]AlertName
Alert BPR MitigationstringOnAlert_IFVG
Message FrequencystringOnce Per BarFrequncy
Show Alert time by Time ZonestringUTCUTC
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.

Similar Pine Scripts

ICT Equal Highs and Lows

by ArunKBhaskar
575 stars

This overlay indicator finds pivot highs and lows on the price chart and compares the last two highs and the last two lows. When the percentage difference between a pair is below the Equal HL threshold, it treats them as equal levels and draws a box. Left and

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows

DE-tracker

by Allen1212
303 stars

This indicator plots labels on the TradingView price chart to mark ARK Invest's buy and sell trades for the DE stock. Buy transactions appear in green with X1 or X2 multipliers showing the number of ARK ETFs involved on the same day; sells appear in red. The m

Indicator v4 Support & resistanceSMC / ICT / price action
Updated 2 years ago · None stated GitHub repository of DE-tracker

This Pine Script indicator plots a ZigZag on the price chart. It identifies reversal points when price moves more than a set percentage from the last pivot. The script calculates forecasts using zigzag data and labels detected geometric patterns including harm

Indicator v4 TrendSupport & resistance

Golden Bullet Strategy

by TradersPost
218 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 3 months ago · None stated GitHub repository of Golden Bullet Strategy

Open Source Fractal

by cantolab
183 stars

This indicator implements the Fractal Model concept to plot market structure shifts, liquidity sweeps, and Change in State of Delivery (CISD) levels. It overlays custom higher-timeframe candle previews, open prices, and time markers directly on the price chart

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · MIT GitHub repository of Open Source Fractal

Swing Failure Signals

by Ganador1
154 stars

This indicator calculates pivot highs and pivot lows to detect liquidity sweeps and Swing Failure Patterns. It identifies when price breaks past recent key swing highs or lows within a configurable historical window, then looks for a quick reversal or change i

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · Apache-2.0 GitHub repository of Swing Failure Signals

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers