OPEN-SOURCE SCRIPT
SMC Minimal Setup

//version=5
indicator("SMC Minimal Setup", overlay=true)
// === INPUTS ===
swingLeft = input.int(5, "Swing Left")
swingRight = input.int(5, "Swing Right")
structureLookback = input.int(20, "Structure Lookback")
// === MARKET STRUCTURE ===
var string structure = "neutral"
if high > ta.highest(high[1], structureLookback)
structure := "bullish"
if low < ta.lowest(low[1], structureLookback)
structure := "bearish"
// === SWING LEVELS ===
relevantHigh = ta.pivothigh(high, swingLeft, swingRight)
relevantLow = ta.pivotlow(low, swingLeft, swingRight)
// === LIQUIDITY SWEEPS ===
sweepHigh = not na(relevantHigh) and high > relevantHigh and close < relevantHigh
sweepLow = not na(relevantLow) and low < relevantLow and close > relevantLow
// === DISPLACEMENT CANDLES ===
bodySize = math.abs(close - open)
candleRange = high - low
avgRange = ta.sma(candleRange, 10)
displacementUp = close > open and bodySize > candleRange*0.6 and candleRange > avgRange
displacementDown = open > close and bodySize > candleRange*0.6 and candleRange > avgRange
// === SETUP ===
bullishSetup = sweepLow and displacementUp
bearishSetup = sweepHigh and displacementDown
plotshape(bullishSetup, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(bearishSetup, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// === FVG ===
bullishFVG = low[1] > high[2]
bearishFVG = high[1] < low[2]
if bullishFVG
box.new(left=bar_index-2, right=bar_index, top=low[1], bottom=high[2], bgcolor=color.new(color.green,85))
if bearishFVG
box.new(left=bar_index-2, right=bar_index, top=high[1], bottom=low[2], bgcolor=color.new(color.red,85))
// === BACKGROUND ===
bgcolor(structure=="bullish" ? color.new(color.green,80) : structure=="bearish" ? color.new(color.red,80) : na)
indicator("SMC Minimal Setup", overlay=true)
// === INPUTS ===
swingLeft = input.int(5, "Swing Left")
swingRight = input.int(5, "Swing Right")
structureLookback = input.int(20, "Structure Lookback")
// === MARKET STRUCTURE ===
var string structure = "neutral"
if high > ta.highest(high[1], structureLookback)
structure := "bullish"
if low < ta.lowest(low[1], structureLookback)
structure := "bearish"
// === SWING LEVELS ===
relevantHigh = ta.pivothigh(high, swingLeft, swingRight)
relevantLow = ta.pivotlow(low, swingLeft, swingRight)
// === LIQUIDITY SWEEPS ===
sweepHigh = not na(relevantHigh) and high > relevantHigh and close < relevantHigh
sweepLow = not na(relevantLow) and low < relevantLow and close > relevantLow
// === DISPLACEMENT CANDLES ===
bodySize = math.abs(close - open)
candleRange = high - low
avgRange = ta.sma(candleRange, 10)
displacementUp = close > open and bodySize > candleRange*0.6 and candleRange > avgRange
displacementDown = open > close and bodySize > candleRange*0.6 and candleRange > avgRange
// === SETUP ===
bullishSetup = sweepLow and displacementUp
bearishSetup = sweepHigh and displacementDown
plotshape(bullishSetup, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(bearishSetup, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// === FVG ===
bullishFVG = low[1] > high[2]
bearishFVG = high[1] < low[2]
if bullishFVG
box.new(left=bar_index-2, right=bar_index, top=low[1], bottom=high[2], bgcolor=color.new(color.green,85))
if bearishFVG
box.new(left=bar_index-2, right=bar_index, top=high[1], bottom=low[2], bgcolor=color.new(color.red,85))
// === BACKGROUND ===
bgcolor(structure=="bullish" ? color.new(color.green,80) : structure=="bearish" ? color.new(color.red,80) : na)
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.