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 strategy, select all of the template text and paste. Press Save and give it a name.
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.
SMC order block and breaker block detection
ATR impulse filter for order block validation
EMA trend filter for trade confirmation
Limit entries at breaker block midpoint with 1:3 R:R ratio
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Impulse ATR
float
1.2
impulseAtr
Trend EMA
int
200
emaP
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 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
Gold Scalping BOS & CHoCH with MA Filter is a strategy that identifies market structure shifts using Break of Structure (BOS) and Change of Character (CHoCH) signals alongside exponential moving average trend filters. Long trades enter when bullish BOS, bullis
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
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
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
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