Indicator · Pine Script v5 · On the chart

BTMM Pattern Detection

by jcortes254

This overlay indicator marks bearish M patterns and bullish W patterns on the price chart, with optional structure lines and labels.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code2,264
Settings40inputs
LicenceNone stated
Last update1 year ago10 Jul 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 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.

Details

Published by

jcortes254 on GitHub

Draws

On the price chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Enable M Patterns (Bearish)booltrueenable_m_patterns
Enable W Patterns (Bullish)booltrueenable_w_patterns
Minimum Pattern Duration (bars)int8min_pattern_bars
Pattern Tolerance (%)float0.002pattern_tolerance
Show Pattern Structure Linesbooltrueshow_pattern_structure
Enable Evening Stars (Bearish)booltrueenable_evening_stars
Enable Morning Stars (Bullish)booltrueenable_morning_stars
Enable Railroad Tracksbooltrueenable_railroad_tracks
Enable Cordofwoodsbooltrueenable_cordofwoods
Minimum Nameable StrengthstringMODERATEnameable_strength_filter
Line Widthint2line_width
Label Sizestringnormallabel_size
Show all 40 settings
SettingTypeDefaultVariable
Show Pattern Labelsbooltrueshow_pattern_labels
Enable Order Block Detectionbooltrueenable_order_blocks
Enable Fair Value Gap Detectionbooltrueenable_fvg_detection
Enable Break of Structurebooltrueenable_bos_patterns
Enable V1/V2 Day 2 Patternsbooltrueenable_v1_v2_patterns
Enable A1/A2 Day 3 Patternsbooltrueenable_a1_a2_patterns
Require HTF Bias Confluencebooltruerequire_htf_bias
Require EMA Stack Confluencebooltruerequire_ema_stack
Require Volume Confirmationbooltruerequire_volume_conf
Minimum Pattern Strengthfloat70.0min_pattern_strength
Min Body Size (ATR)float0.5ob_min_body_size
Max Wick Size (ATR)float0.3ob_max_wick_size
Order Block Lookbackint10ob_lookback_bars
Min FVG Size (ATR)float0.2fvg_min_size
FVG Lookback Barsint20fvg_max_lookback
Show Order Blocksbooltrueshow_order_blocks
Show Fair Value Gapsbooltrueshow_fair_value_gaps
Show Structure Linesbooltrueshow_structure_lines
Bullish Order Blockcolorcolor.new(color.green, 80)bull_ob_color
Bearish Order Blockcolorcolor.new(color.red, 80)bear_ob_color
Bullish FVGcolorcolor.new(color.blue, 85)bull_fvg_color
Bearish FVGcolorcolor.new(color.orange, 85)bear_fvg_color
Enable M Patterns (Bearish)booltrueenable_m_patterns
Enable W Patterns (Bullish)booltrueenable_w_patterns
Second Leg Focus (Steve Mauro)booltrueenable_second_leg_only
Pattern Detection Lookbackint15pattern_lookback
Pattern Tolerance %float0.002pattern_tolerance
Simple 13 EMA Close Confirmationbooltruesimple_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.

Similar Pine Scripts

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

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · MPL-2.0 GitHub repository of Liquidity Sweep + Close-Back Confirmation
46 stars

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

Indicator v6 Support & resistanceCandlestick patterns Repaints
Updated 8 weeks ago · None stated GitHub repository of HTF Sweep Model with CISD Table

Fractal Reclaim Strength

by selimgrsoy0-commits
12 stars

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

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Fractal Reclaim Strength

ICT HTF Candles (fadi)

by dbruce1990
12 stars

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

Indicator v6 SMC / ICT / price actionCandlestick patterns
Updated 1 year ago · None stated GitHub repository of ICT HTF Candles (fadi)

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

Indicator v6 Candlestick patternsSupport & resistance
Updated 3 days ago · MIT GitHub repository of Tweezer & Kangaroo Zones [WavesUnchained]

Assistant

by eddiebelaval
7 stars

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

Indicator v6 Candlestick patternsSupport & resistance
Updated 3 months ago · None stated GitHub repository of Assistant

More Candlestick patterns scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers