Strategy · Pine Script v5 · On the chart

Breaker Block

by muammeryldrm42

The Breaker Block strategy identifies failed Smart Money Concepts (SMC) order blocks and trades their retests.

View on GitHub

GitHub stars7on the repository
Pine versionv5runs as is
Lines of code52
Settings2inputs
LicenceMIT
Last update3 months ago8 Jul 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  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 strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

52 lines of Pine Script v5 from public/code/smc__breaker_block.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

smc__breaker_block.pine
//@version=5
strategy("Breaker Block", overlay=true,
         default_qty_type=strategy.percent_of_equity, default_qty_value=10)

impulseAtr = input.float(1.2, "Impulse ATR")
emaP       = input.int(200, "Trend EMA")

atrVal = ta.atr(14)
emaT   = ta.ema(close, emaP)

bullOB = close[1] < open[1] and (high - low[1]) >= atrVal * impulseAtr and close > high[1]
bearOB = close[1] > open[1] and (high[1] - low) >= atrVal * impulseAtr and close < low[1]

var float bullTop = na, var float bullBot = na, var bool bullBroken = false
var float bearTop = na, var float bearBot = na, var bool bearBroken = false

if bullOB
    bullTop := high[1]
    bullBot := low[1]
    bullBroken := false

if bearOB
    bearTop := high[1]
    bearBot := low[1]
    bearBroken := false

if not na(bullBot) and close < bullBot
    bullBroken := true
if not na(bearTop) and close > bearTop
    bearBroken := true

// Failed bullish OB -> short on retest
shortBreaker = bullBroken and high >= bullBot and low <= bullTop and close < emaT
// Failed bearish OB -> long on retest
longBreaker  = bearBroken and high >= bearBot and low <= bearTop and close > emaT

if longBreaker and strategy.position_size == 0
    sl   = bearBot - 0.5 * atrVal
    entry= (bearTop + bearBot) / 2
    risk = entry - sl
    strategy.entry("Breaker L", strategy.long, limit=entry)
    strategy.exit("X", "Breaker L", stop=sl, limit=entry + risk * 3)

if shortBreaker and strategy.position_size == 0
    sl   = bullTop + 0.5 * atrVal
    entry= (bullTop + bullBot) / 2
    risk = sl - entry
    strategy.entry("Breaker S", strategy.short, limit=entry)
    strategy.exit("X", "Breaker S", stop=sl, limit=entry - risk * 3)

plotshape(longBreaker,  "BL", shape.triangleup,   location.belowbar, color.aqua)
plotshape(shortBreaker, "BS", shape.triangledown, location.abovebar, color.fuchsia)

Overview

Breaker Block uses an ATR impulse condition to detect bullish and bearish order blocks, tracking when price breaks through them. When price retests a broken order block in alignment with a trend-filtering EMA, the strategy places limit orders at the midpoint of the block. Trades are automatically managed with ATR-based stop losses and a fixed 1:3 risk-to-reward target.

Details

Published by

muammeryldrm42 on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

SMC / ICT / price action, Trend, Moving averages

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.

Topics

cryptofuturessodexsosovaluestrategyvaluechain

Settings

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

SettingTypeDefaultVariable
Impulse ATRfloat1.2impulseAtr
Trend EMAint200emaP
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

Try Trading Future

by dearvn
257 stars

This futures trading strategy combines Fair Value Gap (FVG) detection filtered by Average True Range (ATR) with multi-timeframe Exponential Moving Averages (8, 55, and 165 lengths). It identifies entry setups during a defined intraday trading session window wh

Strategy v5 SMC / ICT / price actionMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Try Trading Future

FilledValueGap E002

by ruckard
13 stars

FilledValueGap E002 is a trading strategy that enters positions opposite to the direction of a filled value gap, operating on the premise that the prevailing trend will resume after gap completion. It utilizes Curie closing moving averages as trend filters to

Strategy v5 SMC / ICT / price actionTrend
Updated 1 year ago · None stated GitHub repository of FilledValueGap E002

XXX

by MeridianAlgo
9 stars

This multi-timeframe scalping strategy plots moving averages alongside Smart Money Concepts elements on the price chart. It calculates trend signals using configurable moving average types like ALMA, Hull MA, or TEMA across alternate timeframes. It also plots

Strategy v5 TrendMoving averages Repaints
Updated 4 months ago · MIT GitHub repository of XXX

Doge SMA

by hackingthemarkets
474 stars

Doge SMA is a long-only moving-average crossover strategy drawn on the price chart. It calculates a fast and a slow simple moving average of close and enters a long position when the fast average crosses above the slow average, but only inside a user-defined s

Strategy v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Doge SMA

This strategy calculates and plots a fast Exponential Moving Average (EMA) and a slow EMA directly on the main price chart. It enters long trades when the fast EMA crosses above the slow EMA and exits when the fast EMA crosses below the slow EMA. Inputs allow

Strategy v6 TrendMoving averages
Updated today · AGPL-3.0 GitHub repository of Forven S01508 — Simple EMA20/50 Cross

More strategys

Trade Your Charts With a Regulated Broker

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

Compare brokers