A pattern scanner that looks for symmetrical discount and premium structures built from confirmed pivots, then scores each one against symmetry, trend, volume, depth and structure weights.
1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
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
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
Only patterns above a minimum quality score are shown, and optional volatility, momentum and liquidity filters can remove weaker ones. It draws the patterns, labels and projected target levels on the price chart, with selectable target modes for long and short cases. Pivot widths, tolerances and weights are adjustable. Patterns depend on pivots, which confirm after several bars.
Discount and premium pattern detection from pivots
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Show Historical Patterns
bool
false
vip_show_historical
✅ Enable DISCOUNT Pattern
bool
true
vip_enable_discount
✅ Enable PREMIUM Pattern
bool
true
vip_enable_premium
Left Pivots
int
6
vip_left_candles
Right Pivots
int
4
vip_right_candles
Min Pattern Width
int
12
vip_min_pattern_width
Symmetry Tolerance %
float
1.8
vip_symmetry_tolerance
Min Structure Length
int
12
vip_min_structure_length
Min Trend Depth
int
12
vip_min_trend_depth
Trend Scan Range
int
55
vip_trend_scan_range
Extension Multiplier
float
2.2
vip_extension_factor
Min Quality Score
int
65
vip_min_quality_threshold
Show all 40 settings
Setting
Type
Default
Variable
Symmetry Weight
float
32.0
vip_symmetry_weight
Trend Weight
float
22.0
vip_trend_weight
Volume Weight
float
22.0
vip_volume_weight
Depth Weight
float
16.0
vip_depth_weight
Structure Weight
float
16.0
vip_structure_weight
Enable Volatility Filter
bool
true
vip_use_volatility_filter
Volatility Period
int
16
vip_volatility_period
Enable Momentum Filter
bool
true
vip_use_momentum_filter
Momentum Period
int
16
vip_momentum_period
Momentum Threshold
float
22.0
vip_momentum_threshold
Enable Liquidity Filter
bool
true
vip_use_liquidity_filter
Liquidity Period
int
22
vip_liquidity_period
Discount LONG Target
string
Balanced
vip_discount_long_mode
Discount SHORT Target
string
Conservative
vip_discount_short_mode
Premium SHORT Target
string
Balanced
vip_premium_short_mode
Premium LONG Target
string
Conservative
vip_premium_long_mode
Label Size
string
Small
vip_label_scale
Discount Text Color
color
color.new(#00FFA3, 0)
vip_discount_text_color
Discount Background
color
color.new(#9D4EDD, 80)
vip_discount_bg_color
Discount Elite Quality
color
color.new(#00E5FF, 0)
vip_discount_elite
Discount Premium Quality
color
color.new(#9D4EDD, 0)
vip_discount_premium
Discount Standard Quality
color
color.new(#696969, 0)
vip_discount_standard
Premium Text Color
color
color.new(#FF0080, 0)
vip_premium_text_color
Premium Background
color
color.new(#FF0080, 80)
vip_premium_bg_color
Premium Elite Quality
color
color.new(#FF0080, 0)
vip_premium_elite
Premium Mid Quality
color
color.new(#9D4EDD, 0)
vip_premium_mid
Premium Standard Quality
color
color.new(#696969, 0)
vip_premium_standard
Target Achieved Color
color
color.new(#00FFA3, 0)
vip_target_achieved_color
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.
Sideway Zones Live is an overlay indicator that estimates inner and outer sideways bands from recent highs and lows with a rational quadratic kernel. It tracks swing pivots over a loopback period and counts bars that remain between the outer high and low. Afte
This indicator identifies High Of Low Price (HOLP) and Low Of High Price (LOHP) candlestick setups based on price extremes over a specified lookback period. A HOLP signal triggers when the current bar closes above the high of a recent session low, whereas a LO
This indicator plots dynamic support and resistance levels on the price chart. It detects pivot highs and lows using the pivot length and tracks touches to build strength-based levels. Support and resistance zones appear as colored boxes while lines mark key l
This indicator calculates and plots Donchian Channels directly on the price chart. It determines the highest high and lowest low over a user-selected lookback period using an optimized monotonic deque algorithm, as well as a middle basis line computed as their
This indicator tracks bar lows during consecutive rising highs using Pine Script arrays. When at least four lows accumulate or the price breaches the minimum low in the stack, the script sorts the recorded lows in ascending order and flushes them. It plots up
This indicator tracks smart money market structure directly on the price chart. It calculates dual-period swing highs and swing lows to detect Changes of Character (CHoCH), Breaks of Structure (BOS), inducements, and liquidity sweeps. When structural levels ar