Strong Support / Resistance Only (Flow >= 5)//@version=6
indicator("Strong Support / Resistance Only (Flow >= 5)", overlay=true, max_boxes_count=300, max_labels_count=100)
// ============================================================================
// INPUTS
// ============================================================================
grpSR = "Support / Resistance"
grpFlow = "Flow"
grpVis = "Visual"
lookback = input.int(20, "Pivot Lookback", minval=1, group=grpSR)
boxWidthATR = input.float(1.0, "Zone Width ATR Mult", minval=0.1, step=0.1, group=grpSR)
maxZoneHistory = input.int(50, "Max Zone History", minval=10, maxval=200, group=grpSR)
flowLen = input.int(20, "Flow Strength Length", minval=5, maxval=100, group=grpFlow)
minFlowStrength = input.float(5.0, "Minimum Flow Strength", minval=0.5, step=0.1, group=grpFlow)
showFlowText = input.bool(true, "Show Flow Text", group=grpVis)
extendZones = input.bool(true, "Extend Zones Right", group=grpVis)
// ============================================================================
// FLOW CALCULATION
// ============================================================================
bodySize = math.abs(close - open)
fullRange = math.max(high - low, syminfo.mintick)
bodyRatio = bodySize / fullRange
dir = close > open ? 1.0 : close < open ? -1.0 : 0.0
flowProxy = volume * bodyRatio * dir
flowAvg = ta.sma(math.abs(flowProxy), flowLen)
flowStrength = flowAvg == 0 or na(flowAvg) ? 0.0 : math.abs(flowProxy) / flowAvg
// ============================================================================
// PIVOTS
// ============================================================================
pivotHigh = ta.pivothigh(high, lookback, lookback)
pivotLow = ta.pivotlow(low, lookback, lookback)
pivotFlow = flowStrength
pivotDir = dir
pivotAtrWidth = ta.atr(200) * boxWidthATR
// Sadece güçlü bölgeler
strongSupport = not na(pivotLow) and pivotFlow >= minFlowStrength and pivotDir > 0
strongResistance = not na(pivotHigh) and pivotFlow >= minFlowStrength and pivotDir < 0
anyStrongSR = strongSupport or strongResistance
// ============================================================================
// STORAGE
// ============================================================================
var box lastSupportBox = na
var box lastResistanceBox = na
var array srBoxes = array.new_box()
f_pushBox(box b) =>
array.push(srBoxes, b)
if array.size(srBoxes) > maxZoneHistory
oldB = array.shift(srBoxes)
box.delete(oldB)
// ============================================================================
// DRAW ZONES
// ============================================================================
if strongSupport
supportTop = pivotLow
supportBottom = pivotLow - pivotAtrWidth
lastSupportBox := box.new(
left=bar_index - lookback,
top=supportTop,
right=bar_index + 1,
bottom=supportBottom,
border_color=color.new(color.green, 0),
bgcolor=color.new(color.green, 85),
text=showFlowText ? "Flow: " + str.tostring(math.round(pivotFlow * 100.0) / 100.0) : "",
text_color=color.white,
text_size=size.small
)
f_pushBox(lastSupportBox)
if strongResistance
resistanceBottom = pivotHigh
resistanceTop = pivotHigh + pivotAtrWidth
lastResistanceBox := box.new(
left=bar_index - lookback,
top=resistanceTop,
right=bar_index + 1,
bottom=resistanceBottom,
border_color=color.new(color.red, 0),
bgcolor=color.new(color.red, 85),
text=showFlowText ? "Flow: " + str.tostring(math.round(pivotFlow * 100.0) / 100.0) : "",
text_color=color.white,
text_size=size.small
)
f_pushBox(lastResistanceBox)
// Sağ tarafa uzat
if extendZones
if not na(lastSupportBox)
box.set_right(lastSupportBox, bar_index + 1)
if not na(lastResistanceBox)
box.set_right(lastResistanceBox, bar_index + 1)
// ============================================================================
// OPTIONAL MARKERS
// ============================================================================
plotshape(strongSupport, title="Strong Support", style=shape.triangleup, location=location.belowbar, color=color.new(color.lime, 0), size=size.small, text="SUP")
plotshape(strongResistance, title="Strong Resistance", style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 0), size=size.small, text="RES")
// ============================================================================
// ALERTS
// ============================================================================
alertcondition(strongSupport, title="Strong Support Alert", message="Strong SUPPORT detected | {{ticker}} | TF: {{interval}} | Flow >= threshold")
alertcondition(strongResistance, title="Strong Resistance Alert", message="Strong RESISTANCE detected | {{ticker}} | TF: {{interval}} | Flow >= threshold")
alertcondition(anyStrongSR, title="Any Strong SR Alert", message="Strong SUPPORT/RESISTANCE detected | {{ticker}} | TF: {{interval}} | Flow >= threshold")
Penunjuk Pine Script®






















