TantryNifty Bank IndexNSE:BANKNIFTYsantosh1471//@version=6 indicator("SbC (@ChartingG)", overlay=true) //------------------------------------------------------ // 1. User inputs //------------------------------------------------------ lenVolMa = input.int(20, "Volume MA Length", minval=1) deltaThresh = input.float(0.6, "Delta % Threshold (0–1)", minval=0.1, maxval=1.0) bodyFactor = input.float(1.5, "Body vs ATR Factor", minval=0.5, step=0.1) lookbackLow = input.int(5, "Recent Low Lookback", minval=1) atrLen = input.int(14, "ATR Length", minval=1) //------------------------------------------------------ // 2. Volume-delta approximation //------------------------------------------------------ isUpBar = close > open isDownBar = close < open upVol = isUpBar ? volume : 0.0 dnVol = isDownBar ? volume : 0.0 deltaVol = upVol - dnVol deltaPct = volume > 0 ? deltaVol / volume : 0.0 //------------------------------------------------------ // 3. Volume and candle strength filters //------------------------------------------------------ volMa = ta.sma(volume, lenVolMa) highVol = volume > volMa atrVal = ta.atr(atrLen) bodySize = math.abs(close - open) strongBearBody = close < open and bodySize > bodyFactor * atrVal //------------------------------------------------------ // 4. Breakdown filter //------------------------------------------------------ recentLow = ta.lowest(low, lookbackLow) tookOutLow = close < recentLow //------------------------------------------------------ // 5. Aggressive selling condition //------------------------------------------------------ aggrSelling = strongBearBody and deltaPct < -deltaThresh and highVol and tookOutLow //------------------------------------------------------ // 6. Plotting //------------------------------------------------------ plotshape(aggrSelling, title="Aggressive Selling", style=shape.triangledown, location=location.belowbar, color=color.new(color.red, 0), size=size.large, text="SbC") barcolor(aggrSelling ? color.red : na)