O

Wait 5 sec.

ONifty 50 IndexNSE:NIFTYsuccessfulBird52802//@version=6 indicator("Smart Money Confluence ", overlay=true, max_boxes_count=100, max_lines_count=100, max_labels_count=100) //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // INPUTS //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ groupStructure = "Market Structure" swingLen = input.int(5, "Swing Length", minval=2, maxval=20, group=groupStructure) showStructure = input.bool(true, "Show BOS / CHoCH", group=groupStructure) groupZones = "Supply / Demand" showZones = input.bool(true, "Show Supply / Demand", group=groupZones) zoneLookback = input.int(20, "Zone Lookback", minval=5, maxval=100, group=groupZones) zoneExtend = input.int(30, "Zone Extension", minval=5, maxval=200, group=groupZones) groupFVG = "Fair Value Gap" showFVG = input.bool(true, "Show FVG", group=groupFVG) fvgExtend = input.int(30, "FVG Extension", minval=5, maxval=200, group=groupFVG) minFvgAtr = input.float(0.10, "Minimum FVG Size / ATR", minval=0.0, step=0.05, group=groupFVG) groupLiquidity = "Liquidity Sweep" showSweep = input.bool(true, "Show Liquidity Sweeps", group=groupLiquidity) liqLookback = input.int(20, "Liquidity Lookback", minval=5, maxval=100, group=groupLiquidity) groupSignals = "Signals" minScore = input.int(3, "Minimum Confluence Score", minval=1, maxval=5, group=groupSignals) showSignals = input.bool(true, "Show Buy / Sell Signals", group=groupSignals) groupVisual = "Visual" bullColor = input.color(color.new(color.green, 82), "Demand / Bullish", group=groupVisual) bearColor = input.color(color.new(color.red, 82), "Supply / Bearish", group=groupVisual) fvgBullColor = input.color(color.new(color.aqua, 82), "Bullish FVG", group=groupVisual) fvgBearColor = input.color(color.new(color.orange, 82), "Bearish FVG", group=groupVisual) //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // ATR / BASIC CONDITIONS //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ atr = ta.atr(14) bullCandle = close > open bearCandle = close < open //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // SWING STRUCTURE //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ph = ta.pivothigh(high, swingLen, swingLen) pl = ta.pivotlow(low, swingLen, swingLen) var float lastSwingHigh = na var float lastSwingLow = na if not na(ph) lastSwingHigh := ph if not na(pl) lastSwingLow := pl bullBOS = not na(lastSwingHigh) and close > lastSwingHigh and close = lastSwingLow var int marketBias = 0 bullCHoCH = bullBOS and marketBias == -1 bearCHoCH = bearBOS and marketBias == 1 if bullBOS marketBias := 1 if bearBOS marketBias := -1 //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // LIQUIDITY SWEEP // Sweep = price takes previous high/low but closes back inside //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ previousHigh = ta.highest(high, liqLookback) previousLow = ta.lowest(low, liqLookback) bearSweep = high > previousHigh and close < previousHigh bullSweep = low < previousLow and close > previousLow //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // FAIR VALUE GAP // Bullish FVG: current low > high // Bearish FVG: current high < low //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ bullFVG = low > high and (low - high) >= atr * minFvgAtr bearFVG = high < low and (low - high) >= atr * minFvgAtr if showFVG and bullFVG box.new( left=bar_index - 2, top=low, right=bar_index + fvgExtend, bottom=high, bgcolor=fvgBullColor, border_color=color.new(color.aqua, 20)) if showFVG and bearFVG box.new( left=bar_index - 2, top=low, right=bar_index + fvgExtend, bottom=high, bgcolor=fvgBearColor, border_color=color.new(color.orange, 20)) //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // SUPPLY / DEMAND ZONES // Simplified institutional-style zones from confirmed swing points //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ if showZones and not na(pl) demandTop = math.max(open, close) demandBottom = low box.new( left=bar_index - swingLen, top=demandTop, right=bar_index + zoneExtend, bottom=demandBottom, bgcolor=bullColor, border_color=color.new(color.green, 25)) if showZones and not na(ph) supplyTop = high supplyBottom = math.min(open, close) box.new( left=bar_index - swingLen, top=supplyTop, right=bar_index + zoneExtend, bottom=supplyBottom, bgcolor=bearColor, border_color=color.new(color.red, 25)) //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // CONFLUENCE SCORING //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // BUY: // +1 bullish structure // +1 bullish liquidity sweep // +1 bullish FVG // +1 bullish candle // +1 price above short EMA emaFast = ta.ema(close, 20) emaSlow = ta.ema(close, 50) buyScore = (marketBias == 1 ? 1 : 0) + (bullSweep ? 1 : 0) + (bullFVG ? 1 : 0) + (bullCandle ? 1 : 0) + (emaFast > emaSlow ? 1 : 0) sellScore = (marketBias == -1 ? 1 : 0) + (bearSweep ? 1 : 0) + (bearFVG ? 1 : 0) + (bearCandle ? 1 : 0) + (emaFast < emaSlow ? 1 : 0) // Avoid firing continuously on every candle buySignal = showSignals and barstate.isconfirmed and buyScore >= minScore and buyScore < minScore sellSignal = showSignals and barstate.isconfirmed and sellScore >= minScore and sellScore < minScore //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // PLOTS //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ plot(emaFast, "EMA 20", color=color.new(color.blue, 25)) plot(emaSlow, "EMA 50", color=color.new(color.purple, 25)) if showStructure and bullBOS label.new(bar_index, low, bullCHoCH ? "CHoCH ↑" : "BOS ↑", style=label.style_label_up, color=color.green, textcolor=color.white) if showStructure and bearBOS label.new(bar_index, high, bearCHoCH ? "CHoCH ↓" : "BOS ↓", style=label.style_label_down, color=color.red, textcolor=color.white) if showSweep and bullSweep label.new(bar_index, low, "Liquidity Sweep ↑", style=label.style_label_up, color=color.teal, textcolor=color.white, size=size.small) if showSweep and bearSweep label.new(bar_index, high, "Liquidity Sweep ↓", style=label.style_label_down, color=color.orange, textcolor=color.white, size=size.small) plotshape( buySignal, title="BUY", style=shape.labelup, location=location.belowbar, color=color.lime, text="BUY\n" + str.tostring(buyScore) + "/5", textcolor=color.black, size=size.small) plotshape( sellSignal, title="SELL", style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL\n" + str.tostring(sellScore) + "/5", textcolor=color.white, size=size.small) //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // ALERTS //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ alertcondition(buySignal, "Smart Money BUY", "Smart Money Confluence BUY signal") alertcondition(sellSignal, "Smart Money SELL", "Smart Money Confluence SELL signal") alertcondition(bullSweep, "Bullish Liquidity Sweep", "Bullish liquidity sweep detected") alertcondition(bearSweep, "Bearish Liquidity Sweep", "Bearish liquidity sweep detected") alertcondition(bullFVG, "Bullish FVG", "Bullish Fair Value Gap detected") alertcondition(bearFVG, "Bearish FVG", "Bearish Fair Value Gap detected")