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
346 lines of Pine Script v5 from Tradingview/consecutive-candle-levels-v2.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Users set the streak length (default 3) to identify swing highs and lows. It calculates and displays customizable levels at 0, 100, 38.2, 50, 68, 138, and 150 percent of the range, along with optional positive and negative barriers. Horizontal lines appear on the chart for support and resistance identification. Settings control level visibility, labels, colors, and barrier positions.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Consecutive Candles
int
3
cons_candles
show_0
bool
true
show_0
label_0
string
0
label_0
value_0
int
0
value_0
color_0
color
#787b86
color_0
show_100
bool
true
show_100
label_100
string
100
label_100
value_100
int
100
value_100
color_100
color
#787b86
color_100
show_1
bool
false
show_1
label_1
string
Level 1
label_1
value_1
float
0.382
value_1
Show all 35 settings
Setting
Type
Default
Variable
color_1
color
#787b86
color_1
show_2
bool
false
show_2
label_2
string
Level 2
label_2
value_2
float
0.5
value_2
color_2
color
#787b86
color_2
show_3
bool
false
show_3
label_3
string
Level 3
label_3
value_3
float
0.68
value_3
color_3
color
#787b86
color_3
show_4
bool
false
show_4
label_4
string
Level 4
label_4
value_4
float
1.38
value_4
color_4
color
#787b86
color_4
show_5
bool
false
show_5
label_5
string
Level 5
label_5
value_5
float
1.5
value_5
color_5
color
#787b86
color_5
barrier_pos_lbl
string
+1.65
barrier_pos_lbl
barrier_pos
float
1.65
barrier_pos
barrier_pos_css
color
#b51d1d
barrier_pos_css
barrier_neg_lbl
string
-0.65
barrier_neg_lbl
barrier_neg
float
-0.65
barrier_neg
barrier_neg_css
color
#b51d1d
barrier_neg_css
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 indicator overlays up to five higher-timeframe candlestick groups on the price chart. For each enabled timeframe it requests open, high, low, and close and can show up to five candles, offset by a spacing setting. The main inputs set the candle count, the
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
The Strat Assistant indicator identifies candlestick patterns from the STRAT methodology on the price chart. It detects inside bars, 2-candle directional bars, 3-candle outside bars, and sequences like 212 and 222 for continuations and reversals. Shapes such a
This overlay indicator highlights candles with a body smaller than 50% of their total range by coloring them white on the price chart. Simultaneously, it calculates and plots horizontal lines for open prices across multiple higher timeframes, such as daily, we
This Pine Script indicator identifies liquidity sweeps and confirms signals using a close-back candle pattern directly on the price chart. It tracks recent swing highs and lows over a customizable lookback period. A bullish signal forms when a prior bar sweeps
This overlay indicator draws 80/20 price levels and optional 40-point zone bands on the price chart. It marks repairs, cross sections, and forks with optional letter labels, and can highlight confluence when those marks sit near a level. Separate options shade