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
236 lines of Pine Script v6 from TV Indicators/levels_sr_boxes.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Levels S/R Boxes + Gaps + SL/TP also marks price gaps above a minimum percentage, with an option to show filled ones, and draws stop loss and two take profit lines. The stop distance is an ATR multiple and the targets use two risk-to-reward ratios. Pivot strength, number of levels, box extension and colours are adjustable. Pivots confirm only after several bars.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Pivot Strength
int
10
pivotStrength
Number of Levels
int
3
maxLevels
Box Extension
int
50
boxExtend
Box Height (ATR)
float
0.3
srBoxHeight
Show Gap Fills
bool
true
enableGaps
Min Gap %
float
0.3
minGapPercent
Show Filled Gaps
bool
false
showFilledGaps
Show SL/TP Lines
bool
true
enableSLTP
SL ATR Multiplier
float
2.0
slAtrMult
TP1 Risk:Reward
float
2.0
tpRatio1
TP2 Risk:Reward
float
3.0
tpRatio2
Support Color
color
color.new(color.green, 50)
supportCol
Show all 17 settings
Setting
Type
Default
Variable
Resistance Color
color
color.new(color.red, 50)
resistanceCol
Gap Color
color
color.new(color.purple, 80)
gapCol
Stop Loss Color
color
color.red
slCol
TP1 Color
color
color.green
tp1Col
TP2 Color
color
color.lime
tp2Col
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 plots Donchian Channel boundary lines along with dynamic fan projections directly on the price chart. It calculates the highest high, lowest low, and median price over a customizable lookback period. Whenever price establishes a new channel high
Plots kernel-smoothed price zones on the price chart using a Rational Quadratic kernel from an imported library. It builds an inner and an outer high-low zone from 15-minute highs and lows, plus a smoothed close and a midline, and marks bullish or bearish bars
This indicator plots optional candlestick pattern signals on the price chart. It detects engulfing bars, inside bars, HOLP and LOHP, kicker patterns, body-mass extremes, higher highs and lower lows, ATR warnings, and four-bar fractals. Optional pivot marks use
Dynamic Linear Regression calculates and plots linear regression trendlines and standard deviation channels directly on the price chart over a user-selected time period. Traders can configure static channels locked at the end time, dynamic channels that contin
This indicator overlays trend-following Supertrend bands on the price chart using Average True Range calculations. It plots trailing stop lines, highlights active trend directions, and prints buy or sell shape labels when price closes across band thresholds. I