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
137 lines of Pine Script v4 from [RS]Bar Pattern Statistics Tool.pinescript, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Users can define a pattern sequence of up to ten consecutive bars using specific criteria such as inside bar, outside bar, up bar, down bar, pin bar, or any bar type. The script evaluates historical price history to locate occurrences matching the specified sequence and present statistical feedback. Settings control the pattern length, individual bar types for each sequence position, and text layout options.
Customizable bar pattern sequence configuration
Support for inside, outside, up, down, and pin bars
Historical pattern recognition and matching
Configurable pattern length up to ten consecutive bars
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
How many bars pattern:
int
3
n_bars_in_pattern
#1 in pattern:
string
op_type_01
bar01_type
#2 in pattern:
string
op_type_01
bar02_type
#3 in pattern:
string
op_type_01
bar03_type
#4 in pattern:
string
op_type_01
bar04_type
#5 in pattern:
string
op_type_01
bar05_type
#6 in pattern:
string
op_type_01
bar06_type
#7 in pattern:
string
op_type_01
bar07_type
#8 in pattern:
string
op_type_01
bar08_type
#9 in pattern:
string
op_type_01
bar09_type
#10 in pattern:
string
op_type_01
bar10_type
Text size:
string
size.normal
tex_size
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.
The Bullish/Bearish Candle Series Distribution indicator calculates the length of the current streak of consecutive bullish or bearish candles based on user-selected mode. It tracks streak lengths from 2 to 59 and plots a histogram in a separate pane showing t
This indicator measures directional momentum by evaluating candlestick body proportions and volume over a user-defined lookback window. It computes the ratio of candle body to total range, weights the cumulative value by volume and absolute body size, and dete
This indicator calculates the Qstick value as a simple or exponential moving average of the difference between a chosen close source and open source. It plots that oscillator in a separate pane as a yellow line, draws a dashed zero line, and shades the backgro
This indicator draws a separate OHLC bar series in its own pane using plotbar. Each bar is colored lime when the close is greater than or equal to the open, and red when the close is below the open. It has no user inputs, no signals, and no entry, exit, stop,
This indicator builds a synthetic Heikin-Ashi series using only the current open and the opens of the previous three bars. It derives open, high, low, and close from those values, rounds each price to the symbol mintick, and plots the result as candles in a se
This indicator plots a Cipher B-style oscillator in a separate pane and can source its calculations from Heikin Ashi candles when that option is on. It draws WaveTrend lines with optional buy, gold, sell, and divergence dots, plus overbought and oversold level