indicator · on price · open source

Smart Money Concepts (All) indicator

Smart Money Concepts (All) is a free open-source indicator by @deepwick. Smart Money Concepts (All-in-One) — BOS, CHOCH, bullish / bearish Order Blocks and Fair… Deepwick Script runs a subset of Pine Script.

Deepwick · @deepwickv1Updated 3 Nov 2026▲ 0 users
Running…
Loading chart…

What Smart Money Concepts (All) does

Smart Money Concepts (All-in-One) — BOS, CHOCH, bullish / bearish Order Blocks and Fair Value Gaps on a single overlay.

  • One config that combines the four most common SMC primitives.
  • Labels distinguish BOS (BOS), CHOCH (CH), bullish OB (BOB), bearish OB (SOB).
  • Best for traders who want the full SMC picture without stacking four scripts.
  • Each subsystem caps its own zone count so the chart never gets overwhelmed.
  • Use the colour inputs to match your chart theme and reduce visual clutter.
  • Pair with the premium / discount indicator for high-probability entries on OB retests.
  • The default 30-bar zone expiry keeps the chart clean; raise extendBars-equivalent for longer-lived zones.
  • Alert fires for every BOS, CHoCH, OB, and FVG formation so you can build automations on top.

Source code

Deepwick Script, a subset of Pine Script · read-only

//@version=6
indicator("Smart Money Concepts (All)", overlay=true)
swing = input.int(5, "Swing Length", minval=2, maxval=50)
confirmClose = input.bool(true, "Confirm on Close")
bullColor = input.string("color.green", "Bullish Color")
bearColor = input.string("color.red", "Bearish Color")
transparency = input.int(88, "Box Transparency", minval=50, maxval=99)
alertBosUp = input.bool(true, "Alert on Bullish BOS")
alertBosDn = input.bool(true, "Alert on Bearish BOS")
alertChoch = input.bool(true, "Alert on CHoCH")
alertOb = input.bool(false, "Alert on New OB")
alertFvg = input.bool(false, "Alert on New FVG")
markerColor = input.string("color.gray", "Default Marker Color")
colorDim = input.color("color.maroon", "Color  Dim")
ph = ta.pivothigh(high, swing, swing)
pl = ta.pivotlow(low, swing, swing)
var float lastPh = na
var float prevPh = na
var float lastPl = na
var float prevPl = na
if not na(ph)
    prevPh := lastPh
    lastPh := ph
if not na(pl)
    prevPl := lastPl
    lastPl := pl
bosUp = confirmClose ? close > lastPh : high > lastPh
bosDn = confirmClose ? close < lastPl : low < lastPl
bullChoch = lastPl > prevPl and low < lastPh
bearChoch = lastPh < prevPh and high > lastPl
bullChoch := confirmClose ? (bullChoch and close > lastPh) : bullChoch
bearChoch := confirmClose ? (bearChoch and close < lastPl) : bearChoch
var float obBullTop = na
var float obBullBot = na
var float obBearTop = na
var float obBearBot = na
var int obBullAge = 9999
var int obBearAge = 9999
if not na(lastPh) and not na(prevPh) and lastPh > prevPh
    found = false
    for i = 1 to math.min(20, swing * 4)
        if not found and close[i] < open[i]
            obBullTop := high[i]
            obBullBot := low[i]
            obBullAge := 0
            found := true
            break
if not na(lastPl) and not na(prevPl) and lastPl < prevPl
    found = false
    for i = 1 to math.min(20, swing * 4)
        if not found and close[i] > open[i]
            obBearTop := high[i]
            obBearBot := low[i]
            obBearAge := 0
            found := true
            break
obBullAge += 1
obBearAge += 1
if obBullAge > 30
    obBullTop := na
    obBullBot := na
if obBearAge > 30
    obBearTop := na
    obBearBot := na
gapBull = low[0] > high[2]
gapBear = high[0] < low[2]
var float fvgBullTop = na
var float fvgBullBot = na
var float fvgBearTop = na
var float fvgBearBot = na
var int fvgBullAge = 9999
var int fvgBearAge = 9999
if gapBull
    fvgBullTop := low[0]
    fvgBullBot := high[2]
    fvgBullAge := 0
if gapBear
    fvgBearTop := low[2]
    fvgBearBot := high[0]
    fvgBearAge := 0
fvgBullAge += 1
fvgBearAge += 1
if fvgBullAge > 30
    fvgBullTop := na
    fvgBullBot := na
if fvgBearAge > 30
    fvgBearTop := na
    fvgBearBot := na
p_OB_Bull_Top = plot(obBullTop, "OB Bull Top", color=bullColor, style=plot.style_linebr)
p_OB_Bull_Bot = plot(obBullBot, "OB Bull Bot", color=bullColor, style=plot.style_linebr)
p_OB_Bear_Top = plot(obBearTop, "OB Bear Top", color=bearColor, style=plot.style_linebr)
p_OB_Bear_Bot = plot(obBearBot, "OB Bear Bot", color=bearColor, style=plot.style_linebr)
p_FVG_Bull_Top = plot(fvgBullTop, "FVG Bull Top", color=color.lime, style=plot.style_linebr)
p_FVG_Bull_Bot = plot(fvgBullBot, "FVG Bull Bot", color=color.lime, style=plot.style_linebr)
p_FVG_Bear_Top = plot(fvgBearTop, "FVG Bear Top", color=colorDim, style=plot.style_linebr)
p_FVG_Bear_Bot = plot(fvgBearBot, "FVG Bear Bot", color=colorDim, style=plot.style_linebr)
fill(p_OB_Bull_Top, p_OB_Bull_Bot, color=color.new(bullColor, transparency))
fill(p_OB_Bear_Top, p_OB_Bear_Bot, color=color.new(bearColor, transparency))
fill(p_FVG_Bull_Top, p_FVG_Bull_Bot, color=color.new(color.lime, transparency + 2))
fill(p_FVG_Bear_Top, p_FVG_Bear_Bot, color=color.new(colorDim, transparency + 2))
plotshape(bosUp and not bosUp[1], "BOS Up", style=shape.triangleup, location=location.belowbar, color=bullColor, text="BOS")
plotshape(bosDn and not bosDn[1], "BOS Dn", style=shape.triangledown, location=location.abovebar, color=bearColor, text="BOS")
plotshape(bullChoch and not bullChoch[1], "Bull Choch", style=shape.triangleup, location=location.belowbar, color=color.lime, text="CH")
plotshape(bearChoch and not bearChoch[1], "Bear Choch", style=shape.triangledown, location=location.abovebar, color=colorDim, text="CH")
alertcondition(bosUp and not bosUp[1], "BOS Up", "Smart Money break of structure to the upside")
alertcondition(bosDn and not bosDn[1], "BOS Down", "Smart Money break of structure to the downside")
alertcondition(bullChoch and not bullChoch[1], "Bull CHoCH", "Smart Money change of character to upside")
alertcondition(bearChoch and not bearChoch[1], "Bear CHoCH", "Smart Money change of character to downside")
alertcondition(not na(obBullTop) and na(obBullTop[1]), "Bullish OB", "Bullish order block formed")
alertcondition(not na(obBearTop) and na(obBearTop[1]), "Bearish OB", "Bearish order block formed")

Comments

No comments yet.

Sign in to comment.