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
BTMM Pattern Detection also detects evening and morning stars, railroad tracks, and cordofwoods, and can draw order blocks, fair value gaps, and break-of-structure lines. Settings control pattern duration and symmetry, minimum strength, body and wick size, lookback, and whether higher-timeframe bias, an EMA stack, or volume confirmation is required. It does not place trades or define exits.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Enable M Patterns (Bearish)
bool
true
enable_m_patterns
Enable W Patterns (Bullish)
bool
true
enable_w_patterns
Minimum Pattern Duration (bars)
int
8
min_pattern_bars
Pattern Tolerance (%)
float
0.002
pattern_tolerance
Show Pattern Structure Lines
bool
true
show_pattern_structure
Enable Evening Stars (Bearish)
bool
true
enable_evening_stars
Enable Morning Stars (Bullish)
bool
true
enable_morning_stars
Enable Railroad Tracks
bool
true
enable_railroad_tracks
Enable Cordofwoods
bool
true
enable_cordofwoods
Minimum Nameable Strength
string
MODERATE
nameable_strength_filter
Line Width
int
2
line_width
Label Size
string
normal
label_size
Show all 40 settings
Setting
Type
Default
Variable
Show Pattern Labels
bool
true
show_pattern_labels
Enable Order Block Detection
bool
true
enable_order_blocks
Enable Fair Value Gap Detection
bool
true
enable_fvg_detection
Enable Break of Structure
bool
true
enable_bos_patterns
Enable V1/V2 Day 2 Patterns
bool
true
enable_v1_v2_patterns
Enable A1/A2 Day 3 Patterns
bool
true
enable_a1_a2_patterns
Require HTF Bias Confluence
bool
true
require_htf_bias
Require EMA Stack Confluence
bool
true
require_ema_stack
Require Volume Confirmation
bool
true
require_volume_conf
Minimum Pattern Strength
float
70.0
min_pattern_strength
Min Body Size (ATR)
float
0.5
ob_min_body_size
Max Wick Size (ATR)
float
0.3
ob_max_wick_size
Order Block Lookback
int
10
ob_lookback_bars
Min FVG Size (ATR)
float
0.2
fvg_min_size
FVG Lookback Bars
int
20
fvg_max_lookback
Show Order Blocks
bool
true
show_order_blocks
Show Fair Value Gaps
bool
true
show_fair_value_gaps
Show Structure Lines
bool
true
show_structure_lines
Bullish Order Block
color
color.new(color.green, 80)
bull_ob_color
Bearish Order Block
color
color.new(color.red, 80)
bear_ob_color
Bullish FVG
color
color.new(color.blue, 85)
bull_fvg_color
Bearish FVG
color
color.new(color.orange, 85)
bear_fvg_color
Enable M Patterns (Bearish)
bool
true
enable_m_patterns
Enable W Patterns (Bullish)
bool
true
enable_w_patterns
Second Leg Focus (Steve Mauro)
bool
true
enable_second_leg_only
Pattern Detection Lookback
int
15
pattern_lookback
Pattern Tolerance %
float
0.002
pattern_tolerance
Simple 13 EMA Close Confirmation
bool
true
simple_ema_confirmation
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 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 a set of higher-timeframe candles on the price chart. The user sets the timeframe or lets it select automatically, plus candle count, size, offset, margin, and whether the candles are standard or Heikin Ashi. A table can show the a
The indicator tracks four-bar fractal sweep and reclaim setups on chart timeframes of 15 minutes and above. It calculates Reclaim Strength based on where C2 closes relative to C1's range and plots level lines for the swept C1 extreme and C2 extreme. An on-scre
ICT HTF Candles displays higher timeframe candle structures directly on the price chart using customized boxes and lines. It tracks up to six user-defined higher timeframes, plotting historical body, wick, and imbalance zones alongside optional price level tra
This overlay indicator detects tweezer tops and bottoms and kangaroo-tail pin bars, then draws supply and demand zones from those patterns. It scores each zone, decays freshness, merges overlapping zones, and can invalidate a zone after a close-through or afte
Assistant is an overlay indicator that marks candles with small or missing upper and lower wicks, using a threshold relative to body size. It plots three-candle and five-candle swing fractals as triangles two bars back, and fires alerts when a bullish or beari