//@version=6 indicator("WEAI Pro — Smart Money Engine", "WEAI Pro", overlay = true, max_labels_count = 200) orbSession = input.session("0930-1000", "ORB Session / 오프닝 레인지") htf = input.timeframe("240", "Higher timeframe / 상위 시간봉") volLen = input.int(20, "Relative volume length") emaFast = ta.ema(close, 20) emaSlow = ta.ema(close, 50) vwapValue = ta.vwap(hlc3) htfClose = request.security(syminfo.tickerid, htf, close, lookahead = barmerge.lookahead_off) htfEma = request.security(syminfo.tickerid, htf, ta.ema(close, 50), lookahead = barmerge.lookahead_off) relVol = volume / math.max(ta.sma(volume, volLen), 1) inOrb = not na(time(timeframe.period, orbSession)) newOrb = inOrb and not inOrb[1] var float orbHigh = na var float orbLow = na if newOrb orbHigh := high orbLow := low else if inOrb orbHigh := math.max(orbHigh, high) orbLow := math.min(orbLow, low) liquiditySweepLow = low < ta.lowest(low[1], 10) and close > open and relVol > 1.2 liquiditySweepHigh = high > ta.highest(high[1], 10) and close < open and relVol > 1.2 longSignal = close > orbHigh and emaFast > emaSlow and close > vwapValue and htfClose > htfEma and relVol > 1.1 shortSignal = close < orbLow and emaFast < emaSlow and close < vwapValue and htfClose < htfEma and relVol > 1.1 plot(emaFast, "EMA 20", color.rgb(75, 145, 255), 2) plot(emaSlow, "EMA 50", color.rgb(150, 165, 185), 2) plot(vwapValue, "VWAP", color.rgb(200, 169, 107), 2) plot(orbHigh, "ORB High", color.new(color.aqua, 20), style = plot.style_stepline) plot(orbLow, "ORB Low", color.new(color.red, 20), style = plot.style_stepline) plotshape(liquiditySweepLow, "Sell-side sweep", shape.circle, location.belowbar, color.aqua, size = size.tiny, text = "SSL") plotshape(liquiditySweepHigh, "Buy-side sweep", shape.circle, location.abovebar, color.fuchsia, size = size.tiny, text = "BSL") plotshape(longSignal and not longSignal[1], "Pro Long", shape.labelup, location.belowbar, color.rgb(50, 185, 140), text = "WEAI PRO\nLONG", textcolor = color.white, size = size.tiny) plotshape(shortSignal and not shortSignal[1], "Pro Short", shape.labeldown, location.abovebar, color.rgb(215, 70, 90), text = "WEAI PRO\nSHORT", textcolor = color.white, size = size.tiny) alertcondition(longSignal and not longSignal[1], "WEAI Pro Long", "WEAI Pro: institutional conditions aligned LONG on {{ticker}} {{interval}}") alertcondition(shortSignal and not shortSignal[1], "WEAI Pro Short", "WEAI Pro: institutional conditions aligned SHORT on {{ticker}} {{interval}}") alertcondition(liquiditySweepLow or liquiditySweepHigh, "WEAI Liquidity Sweep", "WEAI Pro: liquidity sweep detected on {{ticker}} {{interval}}")